[Freeswitch-dev] mod_lua speed up

Vicente Hernando vhernando at systemonenoc.com
Wed Apr 24 20:58:45 MSD 2013


Hi Michael,

the goal for us is to compile only once the lua script ( in our case it 
performs connections to several redis instances ).

I have still not tested it yet, only wanted to know if it was a crazy 
idea, or was it just plain impossible.

When I get the profiling done I will post it here.


Kind regards,
Vicente.

On 04/24/2013 06:21 PM, Michael Jerris wrote:
> If you profile this, how long do those actually take?  how does that compare to whats needed to clear out a lua state fresh so there is no bleed over to the next usage?
>
> On Apr 24, 2013, at 6:52 AM, Vicente Hernando <vhernando at systemonenoc.com> wrote:
>
>> Hello,
>>
>> looking at src/mod/languages/mod_lua/mod_lua.cpp
>>
>> I see executing lua_init lua_uninit at the beginning and end of every
>> function, then a lua script is loaded from a buffer, compiled and executed.
>>
>>
>> Another approach could be loading some lua scripts at the beginning and
>> compile them. Then create a pool of lua states.
>>
>> Now everytime lua_init is called, instead of initializing lua again, it
>> would take a lua state from the pool if available, otherwise it would
>> create a new one.
>>
>> lua_uninit would reintegrate a lua state into the pool again.
>>
>>
>> At the end, when module is finished being used, the whole pool should be
>> freed.
>>
>>
>> Do you thing it is a worthwhile idea or a crazy idea? Any points?
>>
>>
>> Thanks in advance,
>> Vicente.
>>
>>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>




Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev mailing list