Set setStatus: null and monitorRunDependencies: null explicitly for w…#119
Merged
Conversation
✅ Deploy Preview for webkit-jetstream-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
danleh
approved these changes
Aug 11, 2025
Contributor
danleh
left a comment
There was a problem hiding this comment.
LGTM, with tiny nit/simplifications. Nice find!
75e6c6c to
94c3535
Compare
emscripten generates the following code,
```
if (Module["setStatus"]) {
Module["setStatus"]("Running...");
setTimeout(() => {
setTimeout(() => Module["setStatus"](""), 1);
doRun();
}, 1);
} else {
doRun();
}
```
And this code is ran in the first iteration of wasm benchmarks since it
includes setup code. This causes a problem since it has artificially
inserted setTimeout with 1ms.
1. It can insert 1ms wait time artificially. This is not so great since
it reduces CPU pstate randomly, causing weird perf cliff depending on
CPU's powner management instead of JS engine's quality.
2. The spec requires setTimeout to have some throttling mechanism. So we
can hit some artificial large delay more than 1ms based on how many
nestings we did before (https://webkit.org/blog/13083/speedometer-2-1/)
This patch removes setStatus and monitorRunDependencies so that we will not
use this `setTimeout` code path generated by emscripten. This is already done
for SpiderMonkey shell. So we expand it for the other engines as well.
Close WebKit#118
94c3535 to
1408ec2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…asm tests
emscripten generates the following code,
And this code is ran in the first iteration of wasm benchmarks since it includes setup code. This causes a problem since it has artificially inserted setTimeout with 1ms.
This patch explicitly sets setStatus and monitorRunDependencies to null so that we will not use this
setTimeoutcode path generated by emscripten. This is already done for SpiderMonkey shell. So we expand it for the other engines as well.Close #118