Question: How does it affect the performance of a web application when an execution path contains a CPU-heavy operation, such as calculating a long Fibonacci sequence?
- As Node.js is asynchronous, this is handled by a libuv and a threadpool. The performance will not notably degrade.
- As the application code runs asynchronously within a single thread, the execution will block, accepting no more requests until the operation is completed.
- As Node.js is asynchronous, this is handled by a threadpool and the performance will not notably degrade.
- The current thread will block until the executon is completed and the operating system will spawn new threads to handle incoming requests. This can exhaust the number of allowed threads (255) and degrade performance over time.
Answer: The correct answer of the above question is Option D:The current thread will block until the executon is completed and the operating system will spawn new threads to handle incoming requests. This can exhaust the number of allowed threads (255) and degrade performance over time.