After i readout Docs about
https://nodejs.org/en/docs/guides/dont-block-the-event-loop/
draw 👀 my understanding
https://nodejs.org/en/docs/guides/dont-block-the-event-loop/
draw 👀 my understanding
Interesting lines on Docs
- Node is fast when the work associated with each client at any given time is "small".
- Node can make do with fewer threads, then it can spend more of your system's time and memory working on clients rather than on paying space and time overheads for threads (memory, context-switching).
- Only the Event Loop is allowed to see the "namespace" (JavaScript state) of your application. From a Worker, you cannot manipulate a JavaScript object in the Event Loop's namespace. Instead, you have to serialize and deserialize any objects you wish to share. Then the Worker can operate on its own copy of these object(s) and return the modified object (or a "patch") to the Event Loop.
- Node excels for I/O-bound work, but for expensive computation it might not be the best option
- Whether you use only the Node Worker Pool or maintain separate Worker Pool(s), you should optimize the Task throughput of your Pool(s). To do this, minimize the variation in Task times by using Task partitioning.

No comments:
Post a Comment