<div>The second one needs to init a whole new lua env for each event.  It will be much heavier.</div><div><br><div class="gmail_quote"><div>On Sun, Mar 26, 2017 at 2:02 PM Mimiko &lt;<a href="mailto:vbvbrj@gmail.com">vbvbrj@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;ve asked this a year ago and did go on with script start-up.<br class="gmail_msg">
<br class="gmail_msg">
But I&#39;m still wandering:<br class="gmail_msg">
<br class="gmail_msg">
Did someone compared performance on capturing events using with different hook types:<br class="gmail_msg">
<br class="gmail_msg">
1) Run start-up scripts and do eventconsumer=freeswitch.EventConsumer(&quot;CUSTOM&quot;,&quot;callcenter::info&quot;)<br class="gmail_msg">
2) &lt;hook event=&quot;CUSTOM&quot; subclass=&quot;callcenter::info&quot; script=&quot;catch-event.lua&quot;/&gt;<br class="gmail_msg">
<br class="gmail_msg">
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<br class="gmail_msg">
restart FS.<br class="gmail_msg">
<br class="gmail_msg">
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<br class="gmail_msg">
system every time an event, it is hooked, arise.<br class="gmail_msg">
<br class="gmail_msg">
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<br class="gmail_msg">
example, 10-20 per sec, what will be better method to use from performance point of view?<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Mimiko desu.<br class="gmail_msg">
<br class="gmail_msg">
_________________________________________________________________________<br class="gmail_msg">
Professional FreeSWITCH Consulting Services:<br class="gmail_msg">
<a href="mailto:consulting@freeswitch.org" class="gmail_msg" target="_blank">consulting@freeswitch.org</a><br class="gmail_msg">
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" class="gmail_msg" target="_blank">http://www.freeswitchsolutions.com</a><br class="gmail_msg">
<br class="gmail_msg">
Official FreeSWITCH Sites<br class="gmail_msg">
<a href="http://www.freeswitch.org" rel="noreferrer" class="gmail_msg" target="_blank">http://www.freeswitch.org</a><br class="gmail_msg">
<a href="http://confluence.freeswitch.org" rel="noreferrer" class="gmail_msg" target="_blank">http://confluence.freeswitch.org</a><br class="gmail_msg">
<a href="http://www.cluecon.com" rel="noreferrer" class="gmail_msg" target="_blank">http://www.cluecon.com</a><br class="gmail_msg">
<br class="gmail_msg">
FreeSWITCH-users mailing list<br class="gmail_msg">
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" class="gmail_msg" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br class="gmail_msg">
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br class="gmail_msg">
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br class="gmail_msg">
<a href="http://www.freeswitch.org" rel="noreferrer" class="gmail_msg" target="_blank">http://www.freeswitch.org</a><br class="gmail_msg">
</blockquote></div></div>