Any time when you need to do processing in JavaScript that would last for a noticeable amount of time (ie. greater than 1/10th second) but not require access to the DOM (WebWorkers do not have access to
window or
document). WebWorkers communicate back to the parent web page through a message passing mechanism so it is easy to swamp any performance gains made through background processing in copying data between the two threads if you have a large dataset, however WebWorkers do have access to Ajax so if you wanted to request a large block of data from a server, do some complex processing and then deliver a relatively small result set to the page that would be an ideal scenario for them. There are some
code examples in the spec which you may find helpful.