lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Saddly the test program has two parameters (threads and loops) threads 
> is the number of seperate pthreads to create (which in this case 
> includes lua stack/handle creation and loading the lua script bytecode 
> into a memory buffer.

It is not enough to "pre-load" your scripts in the C meaning (that
is, to put them in memory). You must pre-load them into Lua. The way
your program is written, you are recompiling the script at each loop
iteration (the call to `lua_dobuffer'). This is a somewhat expensive
operation.  You should compile it once (with luaL_loadbuffer) and then
call the result inside the loop.

-- Roberto