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

wamrc (and llvm jit) is too slow for some wasm modules #2124

Open
yamt opened this issue Apr 13, 2023 · 3 comments
Open

wamrc (and llvm jit) is too slow for some wasm modules #2124

yamt opened this issue Apr 13, 2023 · 3 comments

Comments

@yamt
Copy link
Collaborator

yamt commented Apr 13, 2023

wamrc (especially its optimization pass) takes hours on my environment.

wasm module: many_stack7.wasm.zip
its source: https://github.com/yamt/toywasm/blob/f917a189f3970959fb5f2ea72083cc62b88829c6/wat/many_stack.wat.in#L4

if it matters, it's amd64 macos wamrc binary from 1.2.1 release assets.

@yamt yamt changed the title wamrc is too slow for some wasm modules wamrc (and llvm jit) is too slow for some wasm modules Apr 13, 2023
@yamt
Copy link
Collaborator Author

yamt commented Apr 13, 2023

iwasm --llvm-jit seems to have the same problem.

@wenyongh
Copy link
Contributor

Normally the compilation of iwasm --llvm-jit should be much faster than wamrc: (1) it supports lazy compilation in the main thread and only needs to compile the wasm function to call when the function hasn't been compiled, (2) and it supports parallel compilation, there are 4 backend threads compiling at the same time by default.

Besides, for linux/macos x86-64, the multi-tier jit is supported, the fast-jit is launched to compile and run quickly, and when llvm-jit functions are compiled, the fast-jit will be switched to llvm-jit as soon as possible.

It is not easy to reduce the compilation time of wamrc since unlike llvm jit mode, the llvm non-jit mode doesn't support parallel compilation yet.

@yamt
Copy link
Collaborator Author

yamt commented Apr 18, 2023

for this particular module, which is basically a single function, i guess --llvm-jit is slow as wamrc.
multi-tier jit certainly helps.

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

No branches or pull requests

2 participants