Closed Bug 1168981 Opened 5 years ago Closed 2 months ago
Monkey: share asm .js code between workers
This work breaks down into two main pieces: - compile thread- (and thus JSRuntime-) independent code by indirecting through TLS (via the pinned GlobalReg) where necessary - improve dom/asmjscache so that simultaneous and staggered compilation requests for the same asm.js code can share compiled code
A good testcase for this is: live: https://dl.dropboxusercontent.com/u/40949268/emcc/bugs/PhysicsStressTest_16threads/12_PhysicsStressTest.html offline zip of the above: https://dl.dropboxusercontent.com/u/40949268/emcc/bugs/PhysicsStressTest_16threads/PhysicsStressTest_16threads.zip
In the above test case, each worker consumes 15.25MB of compiled asm.js memory, so the estimated waste in that case is 16*15.25MB = 244 MB of memory. (see bug 1244845 and bug 1244841 for related items on about:memory for this test page) Luke mentions a method in comment 0 for fixing this. How difficult is this? It's been a while since that comment, what's the latest thinking here?
I looked into doing this a while back and while it's quite possible, it's not super-easy. I don't have the bandwidth to do this at the moment. I'll note that wasm threads would share the code by construction and, if other browsers ship SAB, they will have the same code duplication, so the priority of this bug is a question of whether devs will ship many-Worker asm.js+SAB or just wait for wasm.
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: Last year
Resolution: --- → INACTIVE
Status: RESOLVED → REOPENED
Resolution: INACTIVE → ---
Status: REOPENED → RESOLVED
Closed: Last year → 2 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.