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

Make wasm-opt faster for Asyncifying CRuby #230

Open
kateinoigakukun opened this issue May 20, 2023 · 1 comment
Open

Make wasm-opt faster for Asyncifying CRuby #230

kateinoigakukun opened this issue May 20, 2023 · 1 comment

Comments

@kateinoigakukun
Copy link
Member

Asyncify pass is super slow against CRuby. Let's optimize the Asyncify pass implementation in Binaryen

@kateinoigakukun
Copy link
Member Author

kateinoigakukun commented May 20, 2023

It looks like the main bottleneck is musl's atomic operations. Actually, multithreaded code doesn't contribute the speed at all... Self-built wasm-opt linked with glibc is 5x faster than the prebuilt binary distributed on GitHub Release of binaryen repo.

$ time BINARYEN_CORES=1 wasm-opt-musl --asyncify -O3 -g --pass-arg=asyncify-ignore-imports -o ruby.opt ../ruby.raw
52.08s user 1.60s system 99% cpu 53.726 total

$ time wasm-opt-musl 
--asyncify -O3 -g --pass-arg=asyncify-ignore-imports -o ruby.opt ../ruby.raw;
252.25s user 496.39s system 1321% cpu 56.640 total

$ time wasm-opt-glibc --asyncify -O3 -g --pass-arg=asyncify-ignore-imports -o ruby.opt ../ruby.raw;
73.84s user 0.42s system 747% cpu 9.927 total

ruby.raw.zip

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

No branches or pull requests

1 participant