Stream: git-wasmtime

Topic: wasmtime / issue #10102 Pulley Performance Tracking


view this post on Zulip Wasmtime GitHub notifications bot (Jan 24 2025 at 16:54):

alexcrichton added the performance label to Issue #10102.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 24 2025 at 16:54):

alexcrichton added the pulley label to Issue #10102.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 24 2025 at 16:54):

alexcrichton opened issue #10102:

I wasnted to open a meta-issue about tracking the performance of Pulley. There's a few items I've identified about improving Pulley's performance which I'm unable to tackle today myself so I'm hoping to track both the meta-topic here of Pulley's performance.

Overall Pulley is in a relatively good spot with respect to performance right now, but Pulley is by no means outstripping other wasm interpreters. Pulley's chief downside from what I can tell is that it's starting from a much lower level of abstraction than other interpreters, CLIF, instead of wasm. This particularly hurts memory accesses where Pulley fundamentally uses two opcodes per memory access: one for the bounds check and one for the actual load/store. In terms of interpreter performance is this pretty costly to turn the interpreter loop twice per load/store where other interpreters are likely only turning the loop once.

That's not to say that Pulley is fundamentally less performant than other interpreters, however. Pulley also has the strengths of an optimizing compiler such as Cranelift to perform relatively advanced optimizations such as hoisting loads/stores out of loops. Pulley also can relatively easily add macro-ops as necessary to improve performance as well.

Locally though what I've seen are performance issues with Pulley are:

I plan on adding more items here over time as I see them, and/or spinning off these to sub-issues as appropriate.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 24 2025 at 16:55):

github-actions[bot] commented on issue #10102:

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:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Jan 24 2025 at 23:32):

fitzgen commented on issue #10102:

Alternatively, rather than making instruction selection support lowering two root instructions at once (which is hard), we could try something like this:

view this post on Zulip Wasmtime GitHub notifications bot (Jan 25 2025 at 00:02):

fitzgen commented on issue #10102:

cc https://github.com/bytecodealliance/wasmtime/issues/10111, since I believe we've seen some pulley benchmarks where a conditional trap was deduplicated within a loop body, but not hoisted up above the loop for a combo of reasons (see that issue for more discussion).

view this post on Zulip Wasmtime GitHub notifications bot (Jan 27 2025 at 18:16):

alexcrichton commented on issue #10102:

For the spectre ops, I think that could work yeah. We currently discard all trap codes in MemFlags on loads/stores but that's mainly because there are none today. That could be used to hook into Pully where we can semantically have instructions that are "trap if addr==0 otherwise do the load/stores". We could then move all macro-ops like *_g32 addressing to these semantics and fold the spectre-check + trapping-load into the new *_g32 ops.

I'll see if I can't play around with that this week.


Last updated: Feb 28 2025 at 03:10 UTC