Closed Bug 884112 Opened 11 years ago Closed 11 years ago

BananaBread built with crunch support has performance issues during loading

Categories

(Core :: JavaScript Engine, defect)

24 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: akligman, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [games:p?])

Check out and build BananaBread (https://github.com/modeswitch/BananaBread/tree/experimental-webrtc-support) with crunch support (enabled by default), then load in Nightly. Browser hangs on my machine and I get a slow script warning.

I bisected mozilla-central and found the patch that might be causing this: https://bugzilla.mozilla.org/show_bug.cgi?id=789593

(Note that decrunching is done in a web worker)
Whiteboard: [games:p?]
This is most likely another case where typed array views of large ArrayBuffers are being sent between threads, and will probably require a patch to the crunch support, cf. bug 881922. In short, instead of

  postMessage(someUint8ArrayVar)

you'll want

  postMessage(Uint8Array(someUint8ArrayVar))

to explicitly copy the portion of the Uint8Array that you want to send, rather than sending the entire contents of the ArrayBuffer. (It used to do that automatically, but the spec now says that views should clone the whole buffer and bug 789593 implements that.)
Interesting. We saw an issue with this on Chrome a while back in some other codebase (Nebula3, and not with crunch but with other workers), pretty sure it was this, but it was never diagnosed that I can remember, we just blindly worked around it in this manner.

Ok, I pushed the fix to emscripten incoming. Alan, can you please check that it fixes the regression?
Cool, you beat me to it :)

I'll give her a go.
Your patch seems to have fixed the problem. Closing.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Blocks: gecko-games
You need to log in before you can comment on or make changes to this bug.