Open hungryzzz opened 1 year ago
Hi, maybe you are testing classic interpreter mode. But you are right about those cases. Interpreters are not great for such cases. The fast interpreter is also about 10x times compared to AOT modes. I tested other running modes too, Fast JIT and LLVM JIT can handle those cases relatively well, about 3x times/1.1x times compared to AOT
Hi, I use the fast interpreter mode to run those cases, so I compare the execution results with Wasm3, which is also an fast interpreter to run Wasm. I also build the Wamr with classic mode(-DWAMR_BUILD_FAST_INTERP=0
), the execution time in classic mode is 2 or more times than the fast-interp mode.
Description
Hi, I run the following attached cases in different Wasm runtimes(after being compiled by
Emscripten
), and I find some performance differences betweenwamr
(fast-interp) andwasm3
.The execution time(collected by
perf-tool
, probe begins when starting to execute the wasm code(wasm_call_function
inwamr
) and end insched:sched_process_exit
) in wamr(fast-interp) is 2x slower than which in wasm3.I run other test cases on such runtimes, the average execution time on
wamr
(fast-interp) is 1.2x times faster than onwasm3
. I also see the previous report in https://github.com/bytecodealliance/wasm-micro-runtime/wiki/Performance and find the similar results. So maybe the above results are a little strange.Then I look though the above cases, and I find they are all about the complicated arithmetic expressions in loop. So I guess maybe wamr(fast-interp) suffers from slow performance when handling such cases.
Hardware & OS
Emscripten
Wasm runtime version
Repreduce
Compile the above C case using Emscripten
emcc -sENVIRONMENT=shell -O2 -s WASM=1 -s TOTAL_MEMORY=512MB flops.c -o flops.wasm
Execute the wasm file in different wasm runtimes and collect the execution time, all the compilation and execution options are default.
c.zip wasm.zip