You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I've found is one of the chunks taking significantly longer to compile despite being similar size.
The difference is that one chunk is not cached in v8 bytecode cache.
After bisecting it for a while I found the culprit inside borc/src/decoder.asm.js
The issue:
Existence of 'use asm' anywhere in the bundle causes v8 to bail out from caching bytecode for the entire file.
Removing 'use asm' is enough to fix it.
This might also be an argument for switching to rust+wasm, but it seems removing 'use asm' is a decent quick fix.
I did not test in a regular website, just a service worker behind an extension. The code path it takes in v8 seems to be the same though.
Removing 'use asm' may have negative impact on performance in FireFox if they kept their asm code paths maintained.
To be clear: I have no expectations about actions from your side. Sharing my findings. I'm here if you need more details on how I got this result and how to test further.
The text was updated successfully, but these errors were encountered:
Background:
I've been tracing performance of a service-worker waking up after it's already been running before.
The code in the service worker is loaded via https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts
It's bundled and the bundle is split into chunks.
What I've found is one of the chunks taking significantly longer to compile despite being similar size.

The difference is that one chunk is not cached in v8 bytecode cache.
After bisecting it for a while I found the culprit inside borc/src/decoder.asm.js
The issue:
Existence of
'use asm'
anywhere in the bundle causes v8 to bail out from caching bytecode for the entire file.Removing
'use asm'
is enough to fix it.This might also be an argument for switching to rust+wasm, but it seems removing
'use asm'
is a decent quick fix.'use asm'
may have negative impact on performance in FireFox if they kept their asm code paths maintained.To be clear: I have no expectations about actions from your side. Sharing my findings. I'm here if you need more details on how I got this result and how to test further.
The text was updated successfully, but these errors were encountered: