This example shows the differences between a computation made in the main thread or in a separate worker.

The "power three" algorithm is un-optimized on purpose, it's made by nesting three for loops

Depending on your CPU, you might see the difference using a higher number (4-core is slowing down around 2000 without web-workers)