Make everything 4% faster by skipping empty tasks [NFC]#8571
Merged
kripken merged 8 commits intoWebAssembly:mainfrom Apr 3, 2026
Merged
Make everything 4% faster by skipping empty tasks [NFC]#8571kripken merged 8 commits intoWebAssembly:mainfrom
kripken merged 8 commits intoWebAssembly:mainfrom
Conversation
Member
Author
|
Unfortunately gcc-11 errors on those function pointers not being constexpr. I tried to find a refactoring workaround among the users of the code, but couldn't. Instead I pushed a hack to avoid constexpr in gcc 11 and earlier. Numbers from another machine, where I could test multiple compilers: So with and without constexpr, there is a 2.5% speedup with this patch on gcc, and 3.5% with clang. |
Member
Author
|
Testing some C++, Dart, and Java, the average speedup is around 4%. |
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.
When a visitor is the original
(that is, empty), and the doVisit is also unchanged,
(that is, it just calls the visitor), then we do not need to queue such
tasks for execution at all.
I had wanted to do this a while ago but just now figured out how to
make the double check work.
Measurements on
-O3on a large Kotlin testcase:Instructions and branches decrease by 5% with almost no noise. Wall time also
shrinks by about 5%, but the noise is around 1% there.