DEV Community

loading...

Discussion on: Parallel computation in the browser with observable webworkers

Collapse
zakhenry profile image
Zak Henry Author

Hmm interesting thought - you’d have to be very careful about how you split the work - for example splitting the store so that each worker is only working on part of the store that any action would only affect that slice of state. I’d be quite dubious of the performance cost though as state transfer and re-merging is probably comparable to the actual reducer cost.

What could be done which would be interesting is offloading all effects to parallel webworkers and keeping the reducers on the main thread. I think this would be a really nice pattern if the effect functions were computationally intensive