# Don’t Block the Event Loop (or the Worker Pool) | Node.js
source: https://ift.tt/OWUESla tags: #literature #inbox #javascript #programming #software-engineering #airtable #javascript uid: 202301260138 —
You can create and manage your own Worker Pool dedicated to computation rather than the Node.js I/O-themed Worker Pool. The most straightforward ways to do this is using Child Process or Cluster.
~Today I learned that the “Worker Child” uses an actual Node.js concept called the “child” process, and isn’t just a random abstraction that Airtable created.~
Actually I think that’s wrong.
However, for complex tasks you should consider bounding the input and rejecting inputs that are too long. That way, even if your callback has large complexity, by bounding the input you ensure the callback cannot take more than the worst-case time on the longest acceptable input. You can then evaluate the worst-case cost of this callback and determine whether its running time is acceptable in your context.
JSON.parse and JSON.stringify are other potentially expensive operations. While these are O(n) in the length of the input, for large n they can take surprisingly long.
If your server manipulates JSON objects, particularly those from a client, you should be cautious about the size of the objects or strings you work with on the Event Loop.