BananaBread does, and I've noticed that startup is slower in chrome, but it wasn't a big difference so I assumed it was that chrome's js engine was a little slower on that engine (sometimes it's a little faster on a codebase, sometimes a little slower). But it makes sense that this could be the same issue, and maybe BananaBread just has less data than you do so it's less noticeable. How big are the chunks you send over?
Btw, one interesting thing to measure here is to add
var t = Date.now();
right before the postMessage, and
console.log('postMessage took ' + (Date.now() - t) + ' ms on size ' + size);
after it, to see how much time is spent in that call. It should be almost instantaneous, even if it does copy the range being sent.
Hmm, thinking about that now, one possible bug could be if chrome copies the entire underlying arraybuffer and not just the view - this might be a way that emscripten programs differ from typical webgl demos, we send small views on a huge buffer. How big did you set TOTAL_MEMORY?
If that theory is correct (likely not, but worth trying) then increasing TOTAL_MEMORY should make the problem worse, that debugging output could help notice that. And this might work around the problem entirely: replace
'data': data ? HEAPU8.subarray((data),(data + size)) : 0
with
'data': data ? new Uint8Array(HEAPU8.subarray((data),(data + size))) : 0
(manually copy into a new small typed array).
If that isn't it (just a guess), then hopefully the chrome devs can clarify what's going on.
- azakai