I/O bound and CPU bound

前端 未结 2 1318
后悔当初
后悔当初 2021-01-06 09:32

Hei.

I\'m using Node.JS with child_process to spawn bash processes. I\'m trying to understand if i\'m doing I/O bound, CPU bound or both.

2条回答
  •  悲哀的现实
    2021-01-06 10:03

    Your Node.js code is I/O bound. It is doing almost none of the CPU work. You can see in your code that you are only creating external tasks and moving around the output from those tasks. You are not using long running loops or heavy math calculations. You are seeing high CPU numbers for the Node.js process because the pdftotext processes are its child processes, and therefore you are seeing its CPU values aggregated.

提交回复
热议问题