Reactor-based framework versus Node.js streaming
gist.github.com
gist.github.com
Why do people treat this as such a discovery? Where did Node claim to be the fastest solution to everything?
The only answer I can think of is that people feel threatened by node.js for some reason, and constantly feel the need to criticize it for not being the best at everything.
If you want to serve a 1mb file a million times, without caching it, or using sendfile, yeah, node will probably be slower compared to other things. It gets really old seeing posts like these.
Perhaps the author of the benchmark will assume that I'm only saying this because I am -- to quote his closing section -- a "dogmatic JVM-hater". Without deigning to reply to that notion, I will point out that preemptively smearing people who would disagree with you is rhetorically rude and generally not a good idea if you want to become right about things.
Unless the person producing the code or setup for the comparative benchmarks is an expert in all the fields he's comparing and handcrafting every single byte to perfection, it WILL all boil down to respective members of said communities pointing just how skewed, unprofessional and unfair the benchmark is.
There's no value to extract from such poney shows most of the time because it generally reduces complex concepts to mere numbers and metrics, with the additional task of managing to handle all the different setups, flags and whatnot in a way that doesn't create an outcry.
I'll admit, netty's interface is annoying, but that aside, from a perf perspective does this offer anything?
1. Reading and parsing HTTP requests, miscellaneous book-keeping.
2. Transferring a (cached) 1 MB file to a socket.
Netty is plenty fast at #1. At #2, both the Java/Groovy code in this benchmark and the corresponding code using Netty (versions >= 3.2.0) will be doing essentially the same thing: they will have the kernel do a zero-copy write from the filesystem cache directly to the socket. (The node.js version given here repeatedly copies from the filesystem cache into a buffer in its heap, and then writes that to the socket. This involves more memory copying and context switching. Neither Netty nor the author's own framework has this issue.)
So, I doubt there would be any significant performance advantage over Netty.