Node.js doesn't have 4 threads, as JavaScript is single-threaded. Node.js' "asynchronous"-ness is a well decorated lie because while you can use async/await in the code, you're only doing that to free the single thread Node.js has to do other things it has planned.
In short, every "async" call, or calls through setTimeout or setImmediate adds the function to a stack of different functions to call. Node.js then go through them in order.
The only right answer to "how to make Node.js fast" is to have several Node.js processes running the same code, and have a way to distribute requests to them.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Node.js doesn't have 4 threads, as JavaScript is single-threaded. Node.js' "asynchronous"-ness is a well decorated lie because while you can use async/await in the code, you're only doing that to free the single thread Node.js has to do other things it has planned.
In short, every "async" call, or calls through
setTimeout
orsetImmediate
adds the function to a stack of different functions to call. Node.js then go through them in order.The only right answer to "how to make Node.js fast" is to have several Node.js processes running the same code, and have a way to distribute requests to them.