3 ms·
This article is over committing the number of web workers and cores. You should not do n cores = n web workers, it should be at best n-2 web workers (or 1). T
by candiddevmike 4y ago
This article is over committing the number of web workers and cores. You should not do n cores = n web workers, it should be at best n-2 web workers (or 1). The reason being this is a consumer device and the cores are absolutely not dedicated to just your app.
- dspillett 4y agoThat and unless you are purely number-crunching, or the work done by the workers is bursty rather than relatively constant, you browser will want some CPU resource the main thread (and display updates) to be responsive.
- Kiro 4y agoWhat problem does it create to use all cores?
- LawTalkingGuy 4y agoIt's for non-server machines which will be running other things like the user's browser. You won't get the same performance on the shared cores so sometimes it's better to just run on the free ones, and without checking/adjusting it's just easier to use n-2 cores. In a production environment you do want to eliminate the other processes.
- Kiro 4y agoThanks. What does n-2 cores mean?
- Dylan16807 4y agon here is the number of cores So subtract two. Leave two free.
- ElectricalUnion 4y agoYou want to use better localized memory structures in faster cache, and you want to allow the use of the higher frequency/IPC cores instead of being thermally/memory bandwidth limited by all the cores being loaded at lower frequency all the time.
- BlueTemplar 4y agoThe article does consider issues like these towards the end.