Comparison
ParallelismvsWeb worker
Parallelism
you split the batch across eight cores so eight rows are genuinely being computed at the same instant.
Executing multiple computations literally simultaneously on multiple execution units. It is an implementation strategy for making concurrent work faster, and it only helps CPU-bound work. Adding parallelism to an I/O-bound service does nothing except increase contention.
Full entry →Web worker
you moved the parsing off to another thread and the interface kept responding while it ran.
A separate thread running a script with no access to the DOM, communicating with the page by message passing. It is the only real answer to CPU-bound work in the browser, and it is under-used because the boundary is awkward: everything crossing it is structured-cloned, which for large objects can cost more than the work saved. Anything touching the DOM has to come back to the main thread, so workers suit computation, not rendering.
Full entry →