Login
You're viewing the ruby.social public feed.
  • Nov 8, 2026, 12:54 AM

    I have figured out how to use "wizer" to create a .wasm module where Lua has been preinitialized and a benchmark program has been loaded and compiled down to bytecode, and will immediately start executing when "main" is called. Once I've annotated the interpreter, this is what will get passed to "weval" for partial evaluation shenanigans.

    💬 1🔄 0⭐ 0

Replies

  • Nov 8, 2026, 1:21 AM

    The particular suite of Lua benchmarks I turned up also checks timings for LuaJITs non-JIT mode, which I forgot existed... I suspect LuaJIT's interpreter would be a _much_ better target for this than PUC Lua, because LuaJIT optimizes the data structure for tables and only turns into a generic hashtable and dispatches to metatables when absolutely necessary. Make optimisations like _that_ visible to the partial evaluator and you're _really_ cooking.

    💬 1🔄 0⭐ 0
  • Nov 12, 2026, 3:36 AM

    I have coerced the benchmark runner into running my .wasm modules and producing this nice graph as part of a nix build. Very strange to me that lua-5.5.1-wasm (the normal Lua interpreter) seems to often measure noticably faster than lua-5.5.1-wizer (a .wasm file running exactly the same interpreter, except the source code already loaded and compiled to bytecode, ready to be executed)

    Pushed what I've got so far (which is mostly nix code) to my forgejo: git.information-superhighway.n

    A colourful graph with "Elapsed time" on the Y axis running from 0 to 4.5 seconds, and an unlabeled X axis that corresponds to 13 benchmark programs run on 6 different Lua interpreters (lua-5.5.1-native, luajit-2.1, luajit-2.1-interp, lua-5.5.1-wasm, lua-5.5.1-wizer, lua-5.5.1-weval).
luajit-2.1 is the fastest on every benchmark, followed by luajit-2.1-interp and lua-5.5.1-native. lua-5.5.1-wasm / lua-5.5.1-wizer / lua-5.5.1-weval cluster around last place.
    💬 1🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0