The second one needs to init a whole new lua env for each event. It will be much heavier. On Sun, Mar 26, 2017 at 2:02 PM Mimiko <vbvbrj@gmail.com> wrote:
I've asked this a year ago and did go on with script start-up.
But I'm still wandering:
Did someone compared performance on capturing events using with different hook types:
1) Run start-up scripts and do eventconsumer=freeswitch.EventConsumer("CUSTOM","callcenter::info") 2) <hook event="CUSTOM" subclass="callcenter::info" script="catch-event.lua"/>
In case of first method, the lua script is read once into memory and is in executing state all time the FS is running. To reload script you need to restart FS.
In case of second method, the lua script is read and executed for every event. No need to restart FS if script is changed. But it is read from file system every time an event, it is hooked, arise.
If events came rarely, then hook event is better in my opinion. If events come lots, then the script should run always. But if events come, for example, 10-20 per sec, what will be better method to use from performance point of view?
-- Mimiko desu.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org