[Freeswitch-dev] mod_lua speed up
Michael Jerris
mike at jerris.com
Wed Apr 24 20:21:11 MSD 2013
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.
>
>
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev
mailing list