Stream: git-wasmtime

Topic: wasmtime / issue #10545 Pulley runs slower for float comp...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 08 2025 at 05:46):

lazytiger opened issue #10545:

use glam::{Mat3A, Vec2};

#[unsafe(no_mangle)]
extern "system" fn test() -> f32 {
    let mut a = Vec2::new(0.0, 0.0);
    for i in 0..1000000 {
        let p = Mat3A::from_angle(i as f32);
        a = p.transform_point2(Vec2::from_angle(i as f32));
    }
    a.x
}

The above code runs 30% slower with pulley than in wasmi.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 08 2025 at 14:27):

alexcrichton added the pulley label to Issue #10545.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 08 2025 at 14:28):

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

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 (Apr 08 2025 at 14:31):

alexcrichton commented on issue #10545:

Thanks for this! This is expected right now in the sense that non-integer related operations basically haven't been optimized at all. There's a fair amount of low-hanging fruit here:

The first and second are mostly just a matter of adding more instructions and adding Cranelift lowerings in a similar manner to integer lowerings. The second is probably going to require Pulley to switch to a 2-byte opcode namespace instead of a simple/extended split. That is a larger refactoring which should also be measured to see the impact of integer ops.

I'll note that I won't personally have time to work on this in the near future, but I wanted to at least write these down.


Last updated: Dec 06 2025 at 07:03 UTC