News for hackers. Stuff that matters.
Re:Demonstrating Web Worker: Sorting a 50K array in your bro... by Drakim on Sunday May 31, 2015 @02:55PM (#9635129)
Fortunately, Transferable Objects (which didn't arrive until a bit after Web Workers) solves this :)

http://updates.html5rocks.com/2011/12/Transferable-Objects-L...

Re:Demonstrating Web Worker: Sorting a 50K array in your bro... by rrss1122 on Sunday May 31, 2015 @10:15PM (#9636476)
Looks like the OP's linked example does not use this, since the sort reported that it took longer when using web workers than when it didn't use web workers, at least a full second longer.

I wonder how much performance would improve if the example did use Transferable Objects.

Re:Demonstrating Web Worker: Sorting a 50K array in your bro... by angersock on Sunday May 31, 2015 @07:28PM (#9636021)
Note that IE can have some issues with transferable objects.

Also note that the messages cannot encapsulate, say, closures or anything else that you can't JSON.stringify()/JSON.parse().

Re:Demonstrating Web Worker: Sorting a 50K array in your bro... by amelius on Sunday May 31, 2015 @05:53PM (#9635714)
If one wants to share data with two different web-workers (doing different computations on the same immutable data), there is still a problem. Or so I suppose (?)
Re:Demonstrating Web Worker: Sorting a 50K array in your bro... by Drakim on Monday June 01, 2015 @08:15AM (#9637975)
Yeah, you'd have to clone the data.
Re:Demonstrating Web Worker: Sorting a 50K array in your bro... by afshinmeh on Sunday May 31, 2015 @02:58PM (#9635136)
I didn't know this, awesome.