I have a lot of lua-script with the same name used for function name (intended for "entry point") and I want to run them. But I want to make it as fast as possible.
After some browsing/googling/thinking I've got two solution.
1., I have a main lua_State. I load the all necessary given and my own libs/functions "into" it. Next I lua_dump() the current lua-script's lua_State's function (with using linked list for chunck container), then I lua_load() it to the main lua_State and then lua_call() the main lua_State. With this solution I don't have to load all the libs for all the scripts. So the main lua_State is an "environment". :)
2., I simply do the libs loading for all lua_State. And then lua_call() them.
The question would be that: Is even the first one logical correct? And if yes, which one would you use? Is there a better solution?
Thanks ahead and sorry for my English.
(And if the first one is really correct, are there some oblivious optimization possibility?)