3 ms·
Node is best-suited for when your API itself does very little CPU work. When it serves mainly as a task-delegator to a DB, other APIs, local disk I/O, etc. All
by _bxg1 6y ago
Node is best-suited for when your API itself does very little CPU work. When it serves mainly as a task-delegator to a DB, other APIs, local disk I/O, etc. All of these are non-blocked by JS and automatically handled by underlying native code in parallel. The main advantage of Node compared to Go is that your front- and back-end can be in the same language, which helps with hiring and can even allow for code-sharing.
That said I don't think Node would ever match Go on raw performance, even in its wheelhouse. It's all about tradeoffs.
- neophyt3 6y agowhat if wasm become production ready... dont u think that cpu intensive will be native and difference will be somewhat closer?
- jwalgenbach 6y agoNo. Wasm is still executing on a virtual machine, and native compiled go code will still be native.
- _bxg1 6y agoThis question isn't so clear-cut. Go is still garbage-collected, which means that depending on what kind of program we're talking about, some well-memory-managed WASM code could conceivably still be faster.