4 ms·
Yea. This headline has to be troll bait. NodeJS is not faster than Java, and it's also not Concurrent. It is single threaded. It makes efficient use of that s
by eigenrick 13y ago
Yea. This headline has to be troll bait. NodeJS is not faster than Java, and it's also not Concurrent. It is single threaded. It makes efficient use of that single thread with an event-oriented model.
That said, I tend to prefer building in NodeJS because it's fast enough for most (unanticipated) use cases.
- rgbrgb 13y agoThere's a difference between concurrency and parallelism. Concurrency is about a programming model for doing multiple independent tasks while parallelism refers to doing them at the same time. For example with node, you can handle requests while waiting for an asynchronous io task like reading a file. http://blog.golang.org/concurrency-is-not-parallelism http://blog.golang.org/concurrency-is-not-parallelism
- eigenrick 13y agoParallelism is doing different parts of the same task at the same time. Concurrency is doing multiple, different tasks simultaneously. Single threaded, event oriented systems can appear to be concurrent. They can never be parallel.
- nkozyra 13y agoYour operating system is concurrent even if it's single threaded. Concurrency is about doing things in the same time period not necessarily at the exact same time.
- nkozyra 13y agoThat said, saying (concurrent) Node is faster than (nonconcurrent) Language X is several distinct levels of stupid. If you introduce blocking into an application then to the user it slower, but in terms of computation it could still be faster by some magnitude. It's like having C block on a network call while having in-browser Javascript concurrently move past it and declaring Javascript faster.
- drdaeman 13y ago> Language X Actually, comparing runtime/platform (Node) to language is completely pointless. Language is, well, only a language, it can't be "faster" or "slower" unless we're talking about coding speed. We have to compare implementations. And even if we treat Java as a platform, contrary to Node it has ton of highly-varying implementations, so it's still pointless without careful clarifying what one compares. Or they may accidentally find out there's a Java variation with green threads somewhere that may break the whole "look, their ugly threads are slow and our event loops are fast" charm. The article is just a pure load of non-sense. Highly flammable, though.
- endeavour 13y agoIt's really not.
- nkozyra 13y agoThanks for your descriptive rebuttal.
- crimsonalucard 13y agoNode offers parallelism through load balanced processes. See cluster.
- memracom 13y agonode.js could be concurrent. You just run multiple node.js processes and leverage the tried and true concurrency of the UNIX process model, which Erlang architecture is based on.