2 ms·
Interesting, but how is this different than Netty? I'll admit, netty's interface is annoying, but that aside, from a perf perspective does this offer anything?
by andrewvc 15y ago
Interesting, but how is this different than Netty?
I'll admit, netty's interface is annoying, but that aside, from a perf perspective does this offer anything?
- pjscott 15y agoFrom a performance perspective, you can split the work here into two parts: 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.