Open Bug 1140451 Opened 9 years ago Updated 2 years ago

Only warn about uncached asm.js compilation if the caching would be useful

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

REOPENED

People

(Reporter: till, Unassigned)

Details

In Shumway, we're using Emscripten's Relooper as an asm.js module. The message about successful compilation contains the recommendation to make loading async so caching works:

"Successfully compiled asm.js code (total compilation time 36ms; unable to cache asm.js in synchronous scripts; try loading asm.js via <script async> or createElement('script'))"

However, loading the module from cache takes ~160ms, so doing this would by highly counterproductive. Can we somehow detect this situation and not emit the warning?

I guess more importantly, can we not cache in this situation?
If this is anything like bug 1135296, then most of that 160ms is actually just blocking on some other runnable to finish running on the main thread (as an annoying impl detail of Gecko, we require a few trips to the main thread during cache lookup; some or all of these can be removed in the future).  But this means that caching is still a win b/c it is removing 36ms of main-thread compilation time from the main thread.

A quick experiment to confirm is to see what the load time is with caching for a no-op app that does nothing but load the one relooper script async.
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
Status: RESOLVED → REOPENED
Resolution: INACTIVE → ---
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.