24 Apr
2013
24 Apr
'13
10:52 a.m.
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.