Sorry, but your browser doesn't support the HTML5 webworkers API. Please try the app on an other browser (Internet Explorer 10+, Firefox 3.5+, Opera 10.60+, Chrome 3+, Safari 4+)

Testing HTML5 web workers

This small app tests how HTML5 web workers can help us to maintain the responsiveness of the page during a quite intensive background computation. The app computes the sum of the natural numbers from 1 to 3333333333 (you can check the result in the console of your browser's developer tools).

It is quite interesting but there is a huge difference between browsers as regards handling this computational task with and without web worker. In my experience the durations of computations were the following:

Browser Duration with worker (seconds) Duration without worker (seconds)
Chrome 38.0 4-7 4-7
Firefox 32.0 4-7 4-70 (!)
IE 10 40-50 (!) 50-60 (!)
Safari 7.1 6-7 4-5
Opera 25.0 5-6 5-14

Such a computation can consideralibly block the responsiveness of the page. One of the solution of avoiding this blocking effect is using web workers.

click to test responsiveness

Time of computation with web worker:

Time of computation without web worker:

You can check the project on Github.