Skip to content

0.19.0

Latest

Choose a tag to compare

@benoitc benoitc released this 04 Dec 22:22
c02915c

Small cached modules now prepare their functions once for use across
requests. Modules that call each other through a shared table do less work
per call, and a chain of indirect tail calls can cross instances at the
same call depth. Rebuild any precompiled unit files you ship. The
generated-code ABI is now 26. Upgrade instructions.

  • Small cached modules. For up to 256 defined functions, wasm:load/1
    prepares the default fused instructions once. Each new process can
    instantiate the module without repeating that work. On the M5 Pro Mac
    mini, a 200-function request went from 114 to 5.6 µs. Its cold load
    rose from 0.89 to 1.08 ms and its cache entry from 364 to 505 KB.
    Small-module measurements.
  • Calls between instances. Compiled indirect calls reuse the target
    they just checked. Each new call still reads the table, so replacing a
    function takes effect on the next call. On the Mac mini, 20,000
    round trips at baseline compiler quality went from 14.36 to 11.98 ms.
    Full quality also ran faster once warm, with higher compile wait and
    peak RSS in some runs. Indirect-call measurements.
  • Indirect tail calls. A return_call_indirect into another
    instance releases the caller's frame and its handlers. One million
    alternating calls completed with max_depth set to four, both
    interpreted and compiled. Tail-call measurements.
  • Writes into guest memory. wasm:write_memory/3 copies eight words
    per loop iteration on aligned runs of at least 64 bytes. A 16 KiB
    write on the Mac mini went from 11.68 to 10.26 µs. The SQLite
    workloads stayed below the 5% improvement threshold. Memory-write measurements.