We have had some anecdotes reported here, but I would also love to hear more.
Generally, web workers do help with web performance and can help with responsiveness, especially if they take long tasks off the main thread and if that helps reduce Input Delay.
However, for INP specifically, because we are measuring the critical rendering path after a single interaction, very often that critical path is constrained to Events updating state, state update causing render update, causing page DOM update, all of which takes time (and especially on complex framework pages such as you may build with next.js). That means that the type of work you can typically move off thread with workers is not typically inside your event handlers, render update, or framework code.
In practice, I have found the the simplest strategies for improving INP on React sites are:
- Confirm you do not suffer from input delay (web-workers, incremental rendering, concurrent features, suspense boundaries, can all help here)
- Split up the work you do in event handlers: critical update first, non-critical remainder later (I think transitions help here)
- Ensure that any rendering updates to the page, even if your app + React can apply them quickly, are not too heavy for the browser rendering/GPU to present within deadline. I see this with rich animations or large page updates in one frame, etc.
But I have limited experience and maybe folks have had more success there.