threadify icon indicating copy to clipboard operation
threadify copied to clipboard

Performance concern on initialize web worker at every function wrapped by threadify

Open ryancat opened this issue 7 years ago • 1 comments

This is more like a thought or possible enhancement. From what I understand, web workers are designed to be slow start and long running. I read an article saying it usually takes around 40 ms to initialize a web worker, which is way over 17ms and may cause lagging in UI.

https://hacks.mozilla.org/2015/07/how-fast-are-web-workers/

I think maybe there should be a way to share the worker and create new ones only when necessary.

ryancat avatar May 08 '18 00:05 ryancat

You are right,

I planned to implement a pool of worker and sending them tasks instead of always starting new workers... but I never done it by lack of time...

Maybe I will implement this when I will have some free time :)

flozz avatar May 08 '18 09:05 flozz