Minor tuning for wasm-gc code running on the arm64 simulator
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox113 | --- | fixed |
People
(Reporter: jseward, Assigned: jseward)
Details
Attachments
(2 files)
Wasm-gc code (compiled by baseline) on the arm64 simulator runs
very slowly; a factor of 500 slowdown compared to natively. Here are
two minor fixes which improve performance marginally.
-
Code::lookupTrap: lift
uint32_t target = ((uint8_t*)pc) - segment(t).base()
out of a loop in which it is invariant; the compiler does not appear to do so. -
The arm64 simulator: inline a couple of small routines which are very
hot -- used for every simulated memory access.
| Assignee | ||
Comment 1•2 years ago
|
||
Code::lookupTrap has
uint32_t target = ((uint8_t*)pc) - segment(t).base();
in a loop in which it is invariant. This patch lifts it out of the loop since
the clang++ 15.0.7 does not appear to do so, even at -O2. Reduces (host)
instruction count by around 10% on some artificial small wasm-gc tests.
| Assignee | ||
Comment 2•2 years ago
|
||
The routines are used for loads and stores, so this minor improvement is
widely applicable. Reduces (host) instruction count by around 2% for
wasm-baseline generated arm64 code.
Depends on D173275
Comment 4•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/774db827a9db
https://hg.mozilla.org/mozilla-central/rev/91aab2296ba3
Description
•