- IndexedDB Documentation
- IndexedDB summary
- IDB Transaction explicit commit proposal
- Transaction Deactivation Chromium checks
They make it possible to run a script in a background thread separate from the main execution thread. It allows the UI to run without being slowed down.
Almost any code can be run inside a worker thread but DOM manipulataion functions, or default methods from the window
object.
Time to instantiate: 40ms Instantiating web workers is pretty efficient but one should try to create as few web workers and reuse them.
postMessage
is fast and takes less than 1ms to run.
Transfer speed is about 80kB/ms for postMessage
.
Data is sent between the worker and the main thread via a system of messages using the postMessage()
method, and can respond to messages using the onmessage
event handler.
Data is copied rather than shared