WebWorker behaves slower in Firefox compared to Chrome
<p>Subject. I have an application, where I spawn a single WebWorker and use it to unzip files in memory. I &quot;postMessage&quot; a single message per file I need, in WebWorker I access the in-memory archive and unzip file and return with postMessage the &quot;Uint8Array&quot; object back to main thread.</p>
<p>In Chrome it works ok: the files come to main thread as soon as they are extracted from zip. But in FireFox there is a 30 second delay, the same delay I had before I rewrote application to use WebWorker. It feels like FireFox has some kind of queue and returns results to main thread only after this queue is empty.</p>
<p>I suspect that such queue could be a queue of incoming postMessages from main thread to WebWorker, but I'm not sure.</p>
<p>Is there a way to overcome this issue in Firefox?</p>
<h1>UPDATE</h1>
<p>I made a logger of sent and received messages for postMessage in WebWorker and received message in onMessage.</p>
<p>And this is what I got:</p>
<p>Chrome: <a href="http://pastebin.com/7TUKwKZc" rel="nofollow noreferrer">http://pastebin.com/7TUKwKZc</a></p>
<p>Firefox: <a href="http://pastebin.com/bSZ0yu33" rel="nofollow noreferrer">http://pastebin.com/bSZ0yu33</a></p>
<p>So basically FireFox is using sync model for messaging with WebWorker thread, while Chrome is using asycn model.</p>
<p>Does somebody know how turn on async'ness for WebWorker threads in FireFox with JS?</p>