Other people say it is faster than JavaScript, but avoid comparison
to Nodejs. But it is allegedly faster than any JavaScript I am likely to
be able to embed.
[Embedding LuaJIT in 30 minutes] gives as its example code a DNS
server written in embedded LUA. Note that it is very easy to embed
LUAJIT in such a way that the operations run amazingly slow.
Web application firewall that is used by Cloudfare was rewritten from
37000 lines of C to 2000 lines of lua. And it handles requests in
2ms. But it needed profiling and all that to find the slowdown
gotchas - everyone who uses LUA JIT winds up spending some time and
effort to avoid horrible pointless slow operations and they need
to know what they are doing.
He recommends embedded LUA JIT as easier to embed and
interface to C than straight LUA. Well, it would be easier for
someone who has an good understanding of what is happening
under the hood.
He also addresses sandboxing. Seems that LUA JIT sandboxes just
fine (unlike Javascript).
Checking his links, it seems that embedded LUA JIT is widely used in
many important applications that need to be fast and have a great
deal of money behind them.
LUA JIT is not available on the computer benchmarks shootout. The
JIT people say the shootout maintainer is being hostile and difficult,
the shootout maintainer is kind of apt to change the subject and
imply the JIT people are not getting off their asses, but I can see
they have done a decent amount of work to get their stuff included.
LUA JIT is a significantly different dialect to LUA, and tends to get
rather different idioms as a result of profiling driven optimization.
It looks like common LUA idioms are apt to bite in LUA JIT for
reasons that are not easy to intuit. Thus there is in effect some hand
precompiling for LUA JIT.
Anecdotal data on speed for LUA JIT:
* lua-JIT is faster than Java-with-JIT (the sun Java), lua-JIT is faster than V8 (Javascript-with-JIT), etc, ...
* As Justin Cormack notes in the comments to the answer below, it is crucial to remark that JITed calls to native C functions (rather than lua_CFunctions) are extremely fast (zero overhead) when using the LuaJIT ffi. That's a double win: you don't have to write bindings anymore, and you get on-the-metal performance. Using LJ to call into a C library can yield spooky-fast performance even when doing heavy work on the Lua side.
* I am personally surprised at luajit's performance. We use it in the network space, and its performance is outstanding. I had used it in the past is a different manner, and its performance was 'ok'. Implementation architecture really is important with this framework. You can get C perf, with minimal effort. There are limitations, but we have worked around all of them now. Highly recommended.