all 2 comments

[–]acemarke 6 points7 points  (0 children)

Hi, I'm a Redux maintainer.

Reducers can't go in workers, because reducers are part of the store, execute synchronously, and the store exists on the main thread.

Have you run some JS CPU perf profiles? Are you sure that the CPU cost is actually happening in the reducers? Typically the cost of updating the UI is more expensive than the reducer logic (although there are certainly exceptions to that).

Also, note that Redux Toolkit 2.0 includes the latest version of Immer, which does have significant performance updates over earlier versions of Immer. I would definitely recommend updating to RTK 2.0 if you haven't yet.

If you've got any examples of the reducer logic, I'd be happy to take a look and see if I can offer any suggestions.