alexcrichton added the pulley label to Issue #9995.
alexcrichton opened issue #9995:
Pulley currently has two methods of dispatch in the interpreter loop, namely one morally using a giant
matchstatement and the other using tail-calls between opcodes. The latter is currently only evaluatable on some architectures (e.g. x64) when optimizations are turned on and LLVM optimizes things right. Rust'sbecomekeyword does not currently work in Nightly.I just did a Sightglass run of these two methods of dispatch in the interpreter and I got:
execution :: cycles :: benchmarks/pulldown-cmark/benchmark.wasm Δ = 14835771.96 ± 525589.74 (confidence = 99%) match.so is 1.17x to 1.19x faster than tail.so! [81442196 82553273.83 87049480] match.so [96420118 97389045.79 102479551] tail.so execution :: cycles :: benchmarks/bz2/benchmark.wasm Δ = 104438181.93 ± 1644379.63 (confidence = 99%) match.so is 1.13x to 1.13x faster than tail.so! [782662505 787350365.15 795150499] match.so [888116768 891788547.08 916663514] tail.so execution :: cycles :: benchmarks/spidermonkey/benchmark.wasm Δ = 674804802.30 ± 21521230.61 (confidence = 99%) tail.so is 1.03x to 1.04x faster than match.so! [19395106358 19464509629.23 19638165876] match.so [18716347537 18789704826.93 18999413981] tail.sowhich I found surprising. The "match" loop was 10-20% faster for bz2/pulldown-cmark where the "tail" loop was only 3-4% faster for spidermonkey. This goes against what I've been measuring on a "fib" micro-benchmark where the "tail" loop is about 20% faster.
This leads me to the conclusion of "I don't know what's going on here" and I wanted to open an issue on this. It's not a maintenance burden at this time to have both implementations, but ideally we wouldn't have two indefinitely.
github-actions[bot] commented on issue #9995:
Subscribe to Label Action
cc @fitzgen
<details>
This issue or pull request has been labeled: "pulley"Thus the following users have been cc'd because of the following labels:
- fitzgen: pulley
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
alexcrichton commented on issue #9995:
Re-executing the above benchmark with
becomeI get:execution :: cycles :: benchmarks/spidermonkey/benchmark.wasm Δ = 711210289.07 ± 6155417.74 (confidence = 99%) tail.so is 1.07x to 1.07x faster than match.so! [11134953717 11152387721.49 11182533909] match.so [10417711873 10441177432.42 10508402475] tail.so execution :: cycles :: benchmarks/bz2/benchmark.wasm Δ = 15585575.86 ± 2815024.21 (confidence = 99%) tail.so is 1.02x to 1.03x faster than match.so! [566640155 571253228.84 637371532] match.so [552447549 555667652.98 584045846] tail.so execution :: cycles :: benchmarks/pulldown-cmark/benchmark.wasm No difference in performance. [55864019 59595363.71 123029907] match.so [55728082 59051261.34 102007803] tail.soso.... unsure what's going on. (this is more what I'd naively expect)
Last updated: Dec 13 2025 at 19:03 UTC