Symptom Description
Hi, I ran the good.wasm and bad.wasm attached in the code.zip, and surprisingly found that when I change the third parameter (iovs_len) of fd_write function call from 1 to 0, the execution time of Wamr became 4x longer. But intuitively, when copying a 0 length data to the fd, the execution time may be shorter.
The execution times in the WasmEdge (AOT) and Wamr(AOT) of both good.wasm and bad.wasm are as follows (measured by time tool):
For good.wasm:
WasmEdge: 0.62s
Wamr: 0.65s
For bad.wasm:
WasmEdge: 0.62s
Wamr: 2.56s
Repreduce Steps
# run on Wamr
wamrc -o $filename-wamr-aot.wasm $filename.wasm
iwasm $filename-wamr-aot.wasm > case.out
# run on WasmEdge
wasmedgec $filename.wasm $filename-wasmedge-aot.wasm
wasmedge $filename-wasmedge-aot.wasm > case.out
Environment
- Wamr commit: ee056d8
- Operating system: Linux ringzzz-OptiPlex-Micro-Plus-7010 6.5.0-18-generic
- Architecture: Intel(R) Core(TM) i5-13500
code.zip