-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Changing an immediate operand from 1 to 0 makes suspicion performance decreasing #8648
Comments
@hungryzzz, would you mind isolating this into a microbenchmark written in assembly and measuring it by itself? (With appropriate values in I am fascinated by this case because the assembly differs in only two ways: the (As to why the instruction moves: in the |
@cfallin Really sorry for my late reply. I found that the above performance decreasing cannot be replayed in another machine so I thought maybe my CPU is too old to run the case well. Therefore I apply a newer generation machine to run experiments. I would close this issue and submit a new one for this case, thank you very much! |
Test Cases
cases.zip
Steps to Reproduce
Hi, I run the attached two cases(
good.wasm
&bad.wasm
) inWasmtime
andWasmEdge
(AOT), and collect their execution time respectively (measured bytime
tool).Expected Results & Actual Results
For
good.wasm
, the execution time in different runtimes are as follows:For
bad.wasm
, the execution time in different runtimes are as follows:The difference between the attached two cases is as follow, i.e., changing the value which will be store to address 0 from
1
to0
outsize the loop, which can bring 1.6s performance decreasing on Wasmtime but has no effect on WasmEdge. Moreover, the address 0 will be then stored the same value 0, so the first storage will not affect the loop in theory.And I check the machine code generated by
Wasmtime
andWasmEdge
, and find the instruction sequence ofWasmtime
is different before and after change but theWasmEdge
one only changes an immediate of an instruction from1
to0
.I have two confusions to the machine code generatd by
Wasmtime
:WasmEdge
is enough.Profiling Information
I use Perf tool to profile the hotspot and the results are as follows:
Versions and Environment
The text was updated successfully, but these errors were encountered: