ShuyaoJiang opened issue #7731:
Summary
Hi, I ran the attached case (C program, compiled to Wasm by
Emscripten
) in different Wasm runtimes, and found abnormal performance inWasmtime
compared with three other runtimes. The execution time of this case (time interval from the start to the end of the execution of Wasm bytecode running command) on different runtimes is as follows:
- Wasmtime: 3057ms
- Wasmer: 920ms
- WasmEdge (AOT): 759ms
- WAMR (AOT): 754ms
Emscripten
- emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.49 (04a0cad4d4c9f5d62876821274d78cd0a52427af)
clang version 18.0.0 (https://github.com/llvm/llvm-project 269685545e439ad050b67740533c59f965cae955)
Target: wasm32-unknown-emscripten
Thread model: posixWasm Runtime Version
- Wasmtime: cli 15.0.0
- Wasmer: 4.2.3
- WasmEdge (AOT): 0.13.5
- WAMR (AOT): 1.2.3
Hardware & OS
- CPU: Intel(R) Xeon(R) E5-2686 v4 CPU @ 2.30GHz
- Memory: 16GB
- OS: Ubuntu 20.04.6 LTS
Additional details
The attached source program is synthesized by a Csmith seed and a code snippet of floating-point (FP) arithmetic. The inserted code snippet is on line
946-1039
of the source program. We found that this abnormal performance would not occur when running the seed program alone. So, we believe that this anomaly may be caused by some improper handling of FP arithmetic. Could you please check this situation? Thank you!
fitzgen commented on issue #7731:
Thanks for the bug report. Could you also separate timing of compilation vs execution for this bug as well? Thanks!
alexcrichton commented on issue #7731:
It's been awhile since this was last opened, but I wanted to be sure to drop in to say thanks for the detailed report, it's appreciated!
I was able to reproduce this and I think I fixed at least some part of the slowdown in https://github.com/bytecodealliance/wasmtime/pull/7818. I haven't dug too much further though.
alexcrichton commented on issue #7731:
I thought that there may be another source of slowdown here but after studying the program a bit more I think that at least everything I know of should be fixed with #7818. I know it's been awhile, but @ShuyaoJiang if you're still interested if you could confirm that #7818 fixes the slowdown you're seeing as well that'd be great!
Last updated: Dec 23 2024 at 12:05 UTC