Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate: Performance on other architectures #2

Open
alexcrichton opened this issue Aug 14, 2024 · 1 comment
Open

Evaluate: Performance on other architectures #2

alexcrichton opened this issue Aug 14, 2024 · 1 comment

Comments

@alexcrichton
Copy link
Collaborator

This proposal should be evaluated on architectures other than x86_64 and numbers/methodology should be recorded in this repository's proposal documentation. This should at least include aarch64 and should ideally include riscv64 and a 32-bit architecture too.

@alexcrichton
Copy link
Collaborator Author

Using https://github.com/alexcrichton/wasm-benchmark-i128 as a source of benchmarks I've analyzed a prototype of i64.{add,sub,mul}128. Numbers here are slowdowns-relative-to-native to lower is better. Negative numbers mean that the wasm is faster than native (take that with a grain of salt these are very-micro micro-benchmarks). This was evaluated with Wasmtime 25 and using Rust nightly-2024-08-20 to compile the wasm module (roughly). The x86_64 machine was Linux with Intel(R) Core(TM) i9-14900K and the aarch64 machine is a macOS M2 pro.

benchmark x86_64 before x86_64 after aarch64 before aarch64 after
blind-sig 616% 76% 325% 78%
lehmer 362% 13% 111% -28%
mul-bignum 386% 28% 187% 10%
fib_10000 120% 9% 72% -2%
shl 94% 94% 35% 30%
shr 101% 102% 35% 35%
div-bignum 353% 168% 218% 111%
sort-signed 81% 95% 79% 79%
sort-unsigned 100% 95% 77% 78%

This to me shows that aarch64 is, in cases where overflow-related instructions can be used, going to see similar performance improvements as x86_64. I unfortunately do not personally have other hardware to test on at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant