Before everything else, NodeJS is as fast as your code. Write an application, and only if it's too slow, profile it and try to optimize the parts necessary. If after a thorough optimization your code is still too slow, try WASM or a more low-level approach.
Why is NodeJS bad for computing, though? I guess, by now, it is a fact that JS itself is rather slow when it comes to processing. That's the reason we have WASM after all. Imho, there are three main reasons why JS is so slow, but which make JS a good language for simple web animations:
- JS's typing system allows a variable to have a changing type, so even if you just use integers, the JSVM will have to assume that during the program run you might change the type and hence has to employ a rather inefficient, but flexible enough, container to hold the data (the "Oddball" class). Modern JSVMs, like V8, can optimize code to use more efficient containers, but that depends on observation most of the time
- Data is always stored in containers, never just as a simple "int" like in C++. That leads to a lot of performance loss, because there is more data and look-ups / pointer hopping involved
- JS is garbage collected, async and has closures. That makes it rather hard to put data on the stack, so all data is stored on the heap. The heap is slower than the stack and requires at least one pointer hop to query from the stack. C++ can use the stack directly, so it's again an unfair comparison.