I would recommend WebWorkers as your first option.
True, they were removed from Android in 2.2, but were also re-added in 4.4 and are now supported by the latest version of all major platforms. See http://caniuse.com/webworkers to see in which version WebWorkers are available.
For browsers without support for WebWorkers I would recommend a fallback with postMessage()
or setTimeout()
, as detailed in Javascript - how to avoid blocking the browser while doing heavy work?