-
Notifications
You must be signed in to change notification settings - Fork 290
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
Big performance regression between 0.31 and 0.32 #914
Comments
Take this with a grain of salt, but I wouldn't be surprised if this was the "runtime inefficiencies" in the "rare case" that you mention in #860 The way |
@tomaka Thanks for reporting! Calling many very small functions is the worst case situation for the Wasmi (register) implementation. Wasmi (stack) actually performs better for many small function calls. Aggressive inlining could maybe help if this indeed is the problem so it is worth a try if possible. The linked relaxed I agree that a 6x performance regression (750ms vs 4.5s) is not reasonable. |
@tomaka The exact Wasm blob that was used and ideally a trace of executed instructions might be helpful if you have them. |
Here's the runtime in hexadecimal. |
I just noticed that the given
It could be worth a try to see if this Besides that I found a new opportunity to improve performance: #920 |
While inspecting the (func $memcpy (;8628;) (type 5) (param i32 i32 i32) (result i32)
local.get 0
local.get 1
local.get 2
call $_ZN17compiler_builtins3mem6memcpy17h7c9cbc967e51fdc6E
)
(func $memset (;8629;) (type 5) (param i32 i32 i32) (result i32)
local.get 0
local.get 1
local.get 2
call $_ZN17compiler_builtins3mem6memset17h7a0db38d43a2ca78E
) Which indicates to me that the Westend runtime is compiled without the Wasm Especially for Wasmi being an interpreter the speed-ups gained could be even way more massive since the built-in cc @tomaka |
After a relatively long investigation and a lot of DMs, this turned out to be caused by |
Calling the
Metadata_metadata
runtime function of the latest Westend runtime with wasmi 0.31 takes around 750ms.Calling the same runtime function with wasmi 0.32 takes around 4.5 seconds in
CompilationMode::Eager
. WithCompilationMode::Lazy
, it's around 5 to 7 seconds.The text was updated successfully, but these errors were encountered: