Test of JavaScript Web Workers

An experiment with Web Workers. The idea is to spawn as many Web Workers, as there are CPU cores on the current machine. Each worker will be responsible for generating random xy coordinates, along with a random RGB color value. The main thread will use these coordinates to draw on a HTML5 Canvas.

Click on the button Run, and see magic happen = )


The sources for this test:

Please note, that for this post it was decided not to use Math.random() directly. Instead, to generate random values, Ultra High Entropy Pseudo-Random Number Generator is used.

PS: On my machine (Intel Core i7), running in Google Chrome, it takes 2605.80s to reach 100% of filled pixels. How fast is your machine? =)