-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Performance issue related to floating-point (FP) arithmetic #7731
Description
Summary
Hi, I ran the attached case (C program, compiled to Wasm by Emscripten) in different Wasm runtimes, and found abnormal performance in Wasmtime 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: posix
Wasm 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!