lua-users home
lua-l archive

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

I tried to spped up my code by converting

retval 1 = some_c_call1(some_args1)
retval 2 = some_c_call2(some_args2)
retval 3 = some_c_call3(some_args3)
retval 4 = some_c_call4(some_args4)

to a collected call looking like this

retval1, retval2, retval3, retval4 = 
collected_c_calls(some_c_call1, some_args1, some_c_call2, some_args2, some_c_call3, some_args3, some_c_call4, some_args4)

the collected_c_calls pops a lua_function from the stack and runs it (thus popinf its args) and the c_calls have been modified to push their results to a different lua stack which i copy back to the original when all functions are done.

I thought this would be faster than the original solution but i get no noticeable speedup

Any thoughts?