Byte Compiling

Just a quick question really - does the Lua implementation in Renoise perform byte compiling?

If so, at which stage does it perform this action? on startup? on a file by file usage basis?

Yes, lua files get compiled to bytecode in memory before they are executed. The interpreter does this internally, this is nothing that Renoise explicitly does.
Would you mind explaining why you wanna know, what you want to solve? ;)

Hi taktik,

I was just interested as I was doing some timing trials in the scripting terminal (testpad.lua) and the first iteration took significantly longer than the others.

So if I understand correctly, on startup, Renoise will load (and byte-compile) each tools ‘main.lua’ and all 'require’d additional files?

Thanks

Yes, but bytecode compiling is pretty fast. Nothing one usually should deal with, even think about. In theory you could precompile all files, but then you’d have to do so for each architecture. See http://lua-users.org/lists/lua-l/2005-06/msg00048.html, which discusses the bytecode portability. Something that Cie also struggles with.

And now for something completely different, beta9!

http://luajit.org/

Yes, I don’t want to go down the route of precompiling as it has too many disadvantages (in my opinion).

However, it’s hard to push the limits when you don’t know what they are! :P ;)