-
Notifications
You must be signed in to change notification settings - Fork 824
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
Abnormal long execution time when running "hello world" #4201
Comments
I've also tried another two machine to run the "hello world" case using It seems that the execution time is related to some features of physical machine. # machine A
-> uname -a
Linux xxx 5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
-> time ../wasmer/target/release/wasmer hello.wasm
hello world
../wasmer/target/release/wasmer hello.wasm 22.44s user 0.69s system 2156% cpu 1.072 total
-> time ../wasmtime/target/release/wasmtime hello.wasm
hello world
../wasmtime/target/release/wasmtime hello.wasm 0.00s user 0.00s system 100% cpu 0.009 total # machine B
-> uname -a
Linux xxx 5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
-> time ../wasmer/target/release/wasmer hello.wasm
hello world
../wasmer/target/release/wasmer hello.wasm 143.59s user 3.07s system 4769% cpu 3.075 total
-> time ../wasmtime/target/release/wasmtime hello.wasm
hello world
../wasmtime/target/release/wasmtime hello.wasm 0.01s user 0.00s system 100% cpu 0.008 total |
that's indeed very long. Can you try again with latest 4.2.0 that just went out yesterday? |
@ptitSeb I've try again with latest commit(cf51f38) of # the first mentioned machine
-> wasmer hello.wasm
⠴ Initializing the WebAssembly VM
Time elapsed in PluggableRuntime::new is: 2.368649716s
hello world
Time elapsed in run_with_store_async() is: 1.672804ms
Time elapsed in execute_inner() is: 2.374535564s # machine A
-> time ../wasmer/target/release/wasmer hello.wasm
hello world
../wasmer/target/release/wasmer hello.wasm 22.17s user 0.77s system 2082% cpu 1.101 total # machine B
-> time ../wasmer/target/release/wasmer hello.wasm
hello world
../wasmer/target/release/wasmer hello.wasm 146.01s user 3.15s system 4762% cpu 3.132 total -> wasmer -vV
wasmer 4.2.0 (cf51f38 2023-09-06)
binary: wasmer-cli
commit-hash: cf51f38568bea3de369d05514640872589dd6c5e
commit-date: 2023-09-06
host: x86_64-unknown-linux-gnu
compiler: singlepass,cranelift |
Can you run with |
@ptitSeb Hi, the log is as followed.
|
where does this line
came from? |
@hungryzzz are you running the official wasmer CLI? Also, it looks like |
@ptitSeb I add some instrumentation code in // Instrumentation code
let start = Instant::now(); // Time begin
let mut rt = PluggableRuntime::new(Arc::new(TokioTaskManager::new(rt_or_handle.into())));
let duration = start.elapsed(); // Time end
println!("Time elapsed in prepare_runtime() is: {:?}", duration); // print the duration |
Hi, I add some instrumentation code in
According to the logs, I find that |
@hungryzzz thanks, that's very helpful. |
I just tested on latest |
Describe the bug
Hi, I build the latest
wasmer
and find a very long execution time (computed bytime
tool) even when running simple "hello world"(as followed).Wasmer
: 2.466sWasmtime
: 0.015sI just insert some instrumentation rust code(as follow) in the
wasmer
project to collect which part of code take the most time, and the result is as follows. I find thatwasmer
spents too much time onPluggableRuntime::new()
.wasmer/lib/cli/src/commands/run/wasi.rs
Line 262 in b03102d
However, when I change another machine to repeat the above steps, the execution time is normal (almost the same as
wasmtime
), so I think maybe this bug is related to the physical machine. But I don't know how to do the further debug.Steps to reproduce
hello.wasm.txt
The text was updated successfully, but these errors were encountered: