← Back to context

Comment by pizlonator

4 hours ago

I bet LuaJIT crushes Zef! Or rather, I would hope that it does, given how much more engineering went into it

There are many runtimes that I could have included but didn’t.

Also, it’s quite impressive how much faster PUC Lua is than QuickJS and Python

Because QuickJS is really slow. Don't be fooled by the name. It's almost an order of magnitude slower than node/v8.

(I suppose the quick in QuickJS means "quick for a pure interpreter without JIT compilation or something...)

  • based on this data, it’s probably slower than JSC’s or V8’s interpreter

    So like that’s wild

> it’s quite impressive how much faster PUC Lua is than QuickJS and Python

Python's execution time is mostly spent looking up stuff. I don't think lua is quite as dynamic.

  • Lua is way more dynamic

    • I suppose it depends on where you are looking for dynamicity. In some ways, lua is much more laissez faire of course.

      But in Python, everything is an object, which is why, as I said, it spends much of its time looking things up. And things like bindings for closures are late, so that's more lookups as well.

      In lua, many things aren't objects, and, for example, you can add two numbers without looking anything up. Another issue, of course, when you do that, is that you could conceivably overflow an integer, but that can't happen in Python either.

      The Python interpreter has some fast paths for specific object types, but it is really limited in the optimizations it can do, because there simply aren't any unboxed types.