title: Does the code of a Node.js child process get parsed every time it gets spawned?
body: <p>It is common practice to outsource a long running task to a child process. Now, I have a long running function (which would block the event loop for several seconds) which I would like to outsource to a child process. Everytime this function gets called, a child process gets spawned and it gets closed after the function returns. Does Node.js somehow cache the intermedidiate representation of that code or does it get parsed every time the child process spawns? And does the code ever get optimized under those conditions?</p>
  
  <p>Fortunately, from what I measured, spawning a child process doesn't add as much of an overhead as I feared it would. But nonetheless, if the code gets parsed every time and never gets optimized it would be a loss of resources.</p>