Add Box2D workload compiled with J2CL/J2Wasm to WasmGC#130
Conversation
Right now, it requires an additional entrypoint in the upstream j2cl benchmark to avoid explicit warmup and perform a constant amount of work (see add-fixed-run-count-api.patch). Since JSC seems to not implement JS-string builtins yet, I also added a workaround (they never get called in this workload anyway), which we can hopefully remove later.
✅ Deploy Preview for webkit-jetstream-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Any comments from Mozilla's side @eqrion and @iainireland? |
|
I'm not seeing names in any of the functions, or a name map checked in along with the benchmark. Could you compile to include the name section? That makes analysing things much easier. Also, would you be open to naming this |
|
Renaming the workloads sounds fine. Regarding function names, I need to fiddle a bit with the Bazel build config, since I don't want to measure a debug build. |
|
Turns out, there already is a |
|
Seems to spend almost half the time in This isn't necessarily a dealbreaker but I'm not sure this will measure J2Wasm as much as these two functions, which is probably less interesting to benchmark. Happy to land disabled for now while we discuss though. |
|
@danleh Have you looked at the wasm for those functions? Do you know if there's anything interesting about them that would be worth optimizing in anger? |
|
Recording our discussion from last week: I would still like to merge this, since it gives us coverage of yet another Wasm toolchain (j2cl/j2wasm) that is used in a widely deployed web application, has been a good workload to catch regressions in v8 in the past according to j2cl folks and our own experience, and according to @eqrion @iainireland is not incentivizing any problematic optimizations. One concern was that we might be having a too high proportion of Wasm workloads, but that should be alleviated by disabling more of the clearly outdated ones in #178. When we merge (at least some) of the new JS workloads, this proportion will go down further as well. I had a look at a x64 CPU profile in d8 as well, and that seems to be not too centered along a single function, see the attached screenshot. @kmiller68 @eqrion How about merging this and tuning or discussing specifics in follow-up PRs? |
|
Merging is good with me. As I said before, we haven't seen anything outrageous about the wasm code here, and it's better than some of the previous wasm benchmarks we've had. Although, obviously not perfect either. |
kmiller68
left a comment
There was a problem hiding this comment.
Seems good to me too. Happy to revisit if anything interesting comes up.

Right now, it requires an additional entrypoint in the upstream j2cl benchmark to avoid explicit warmup and perform a constant amount of work (see add-fixed-run-count-api.patch).
Since JSC seems to not implement JS-string builtins yet, I also added a workaround (they never get called in this workload anyway), which we can hopefully remove later. @kmiller68