6 ms·
Not that speed matters a lot, but it seems they managed to create a new server that is nearly as fast as the fastest C++ server on the techempower benchmarks (h
by MrBuddyCasino 11y ago
Not that speed matters a lot, but it seems they managed to create a new server that is nearly as fast as the fastest C++ server on the techempower benchmarks (https://www.techempower.com/benchmarks/#section=data-r11&hw=peak&test=plaintext https://www.techempower.com/benchmarks/#section=data-r11&hw=...):
*The low-level HTTP API provides access to the extremely fast Rapidoid HTTP
server implemented from scratch on top of Java NIO.*
Thats quite an achievement, considering that Netty is very well optimized. Maybe the off-heap output buffer gives it that edge?
- betimsl 11y agoHow the hell did they manage to do this?
- bottled_poe 11y agoBy not doing much else?
- betimsl 11y agoWhat do you mean by "not doing much else"? I take netty as benchmark when comes to Java and this is MUCH faster.
- coldtea 11y agoHow did they manage to write a fast optimized web server? Lots of people have done so, if you have the skills and determination. It also helps if you focus on that, instead of completeness, like Netty probably does.
- logicchains 11y ago>Maybe the off-heap output buffer gives it that edge? Is this because it allows the GC to be avoided, or because it allows value types to be emulated?
- zapov 11y agoToo bad they didnt use DSL JSON instead of Jackson for JSON test. They would probably edge top C ones then.
- atemerev 11y agoIndeed. (Netty is well-optimized, but quite bloated as well).
- emergentcypher 11y agoJust goes to show that a lot of the "slowness" in Java, et al, comes down to implementation details.
- nikolche 11y agoHi, I am the author of Rapidoid, thanks! The performance optimization is based on: - using off-heap input and output buffers, - minimizing the number of objects that are created when parsing the input and generating the output, - using object pools to reuse the objects that must be created, - using thread-local helper data structures on the I/O threads to avoid synchronization and object instantiation.
- MrBuddyCasino 11y agoThanks for the explanation! So it looks your efforts were mainly focused on reducing GC pressure - makes sense with those throughput numbers.
- betimsl 11y agoWhat happens when you have a long database query running? Is it async (which is a bit impossible with JDBC) but does it block one of the threads in worker pool?