Sometimes I just want to search through my local data in my main thread to process 'n' numbers to show some result to the user and I don't want to lock up the DOM for 'n' milliseconds. I also don't want to make an entire new script file just for processing 'n' numbers, what if I need access to data in my main thread? Do I package 'n' numbers up and then send it as JSON? Well that can take more time then actually processing the numbers....and timers...such a hack.
I don't know all the design decisions behind web workers and I understand the safety of communicating with strings and events, but sometimes I really just want to call 'new Thread()' and have access to all my variables and data in my main thread. Yes it can be dangerous, yes you can fuck it up, but we still have that problem when we try to make our servers fast.
However, maybe I just don't understand how Web Workers work.
In the end the server team ended up implementing a home-grown geo-search on an XML document store with an average query time of several seconds.
- ~55% Chrome
- ~35% Firefox
- ~5% Safari
- 1.5% IE 9+10
- 1% Opera
So for us it make sense to use API even less supported than WebWorkers, like http://caniuse.com/pagevisibilityBut if I was working for a chinese market place, or a bank intranet I'm sure it would be 80% IE6.
If you need to perform CPU heavy calculations or processing of video/audio it just doesn't make sense to do it on the client even with web workers.