Forum
Off Topic LuaJITLuaJIT
8 replies 1
Supports many things.. At least i could connect to MySQL so quickly. So i think it was quite good, but not anymore.
2. Bit operators
The FFI module and the JIT feature are the main reason of why this language turns into a tier 2 scripting language (low-level).
1
2
2
LuaJIT 2.0.4: 24056450 Hz (24 GHz) Lua 5.1: 11443393 Hz (11.4 GHz)
This is the code I used.
1
2
3
4
5
6
2
3
4
5
6
local i = 0 local s = os.clock() while os.clock() - s <= 1 do 	i = i + 1 end print("Speed: "..i.." Hz")
I don't really get those results, it's twice the speed. The first results I ever had and sent to DC were those:
1
2
3
4
2
3
4
14842285 Hz (Zeke.LuaJIT2 in BlitzMax) 6546415 Hz (Pub.Lua in BlitzMax) 5248968 Hz (Counter-Strike 2D) 6630797 Hz (SciTE from Lua for Windows)
In normal Lua the scripts are parsed at runtime which makes it slower.
With Lua JIT however the scripts are compiled to bytecode when you load them (this also happens at runtime but before actually running the scripts - so: just in time). Executing bytecode is much faster than parsing strings so this is why Lua JIT is significantly faster.
1