Uh oh!
There was an error while loading. Please reload this page.
Faster wasm runtime - #51458
Conversation
ghost
commented
Apr 18, 2021
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
benaadams
commented
Apr 18, 2021
@radekdoulik is it possible to test the performance of this with your example in #50260 (comment); I'm not sure how to get a build that can be tested in your harness, I just seemed to make it angry in the console instead |
ghost
commented
Apr 18, 2021
Tagging subscribers to 'arch-wasm': @lewing Issue Details
Trading off code size and performance
Inspired by Is WebAssembly magic performance pixie dust? where they were seeing a ore than x2 perf degradation from
And its currently using
|
| EMCC_DEBUG_FLAGS =-g -Os -s ASSERTIONS=1 -DDEBUG=1 | ||
| EMCC_RELEASE_FLAGS=-Oz --llvm-opts 2 | ||
| EMCC_RELEASE_FLAGS=-O3 --llvm-opts 3 -flto |
There was a problem hiding this comment.
(nit) not that it really matters, but the ordering here is different than what is in the wasm.proj file.
eerhardt
commented
Apr 19, 2021
Does this need to pass Refers to: src/mono/wasm/Makefile:105 in 7ea1fa3. [](commit_id = 7ea1fa3, deletion_comment = False) |
benaadams
commented
Apr 19, 2021
That needs to be passed via |
eerhardt
commented
Apr 19, 2021
I don't believe that Task gets called on non-Windows builds: runtime/src/mono/wasm/wasm.proj Lines 112 to 115 in 8f4a12d vs. runtime/src/mono/wasm/wasm.proj Lines 74 to 80 in 8f4a12d From my understanding the Makefile and the |
radekdoulik
commented
Apr 19, 2021
I am updating my measurement code, so that it becomes more automated and less hassle to use. I will try to run it on your branch and also create PR which will add new sample, similar to |
benaadams
commented
Apr 20, 2021
Added to the Makefile also |
radekdoulik
commented
Apr 20, 2021
Yes, indeed. I plan to unify that, hopefully soon. Opened #51553. |
radekdoulik
left a comment
There was a problem hiding this comment.
I have measured the Json timings.
| measurement | main/interp | PR branch/interp |
|---|---|---|
| Json, non-ASCII text serialize | 8.2714ms | 8.2941ms |
| Json, non-ASCII text deserialize | 11.6825ms | 11.6508ms |
| Json, small serialize | 0.2389ms | 0.2436ms |
| Json, small deserialize | 0.3678ms | 0.3731ms |
| Json, large serialize | 67.8831ms | 69.4267ms |
| Json, large deserialize | 101.1538ms | 102.4038ms |
They are very close, probably just measurement errors. Not sure whether the change is too small or whether the Json [de]serialization is not affected by changes in this PR.
Any suggestion for an area where it might show larger difference?
This change might have more impact with AOT enabled ( I'm also wondering if this may help more the GC itself, what happens if you make lots of allocations during benchmarks? |
radekdoulik
commented
Apr 20, 2021
I think for impact on AOT we would need to also modify |
radekdoulik
commented
Apr 20, 2021
I have opened draft PR with the simple benchmark sample I used to measure the times #51559 |
steveisok
commented
Jun 28, 2021
radekdoulik
commented
Nov 22, 2021
I am sorry @benaadams that this fall off the radar. We switched to @radical, I think the flags can be overridden with |
-O3rather than-Ozfor a faster runtime-fltofor extra optimizations--closure 1which can greatly reduce the size of the JS and more than make up for the increase in the wasm (see: Faster, smaller wasm runtime #51446)Optimizing Code | Link Times
Trading off code size and performance
Inspired by Is WebAssembly magic performance pixie dust? where they were seeing a ore than x2 perf degradation from
-Os:And its currently using
-Ozwhich is even worse for performance than-Os