Search code examples
lualua-api

Can luaL_loadbuffer load multiple files in one call?


I know how to load a Lua file via luaL_loadbuffer. Now I have many Lua files, more than 100. I am thinking about how to speed up the loading process. One way I figured out is: put all files into one, and then load this file using luaL_loadbuffer (I did some tests, but just got syntax error return by luaL_loadbuffer). Does anyone ever use this method? Or is there any other way to speed up the loading?


Solution

  • I replaced Lua with LuaJIT and the loading time reduced to ~6sec. I'm satisfied with this result now.Thanks everybody.