by yc12340 · 7y ago · 0 comments
The author asserts, that "it's virtually impossible to write allocation-free idiomatic Java code, so we still allocate... 20 bytes on average per forwarded packet". This sounds questionable, — does that mean, that he actually performs a JVM memory allocation for _every_ packet?! Furthermore, the specifics of memory management look murky. One implementation uses "volatile" C writes [1] (simply storing data to memory). Another implementations of the same thing uses a full CPU memory barrier [2]. Which one is right?
In my opinion, significant inconsistencies between implementations render any comparison between them invalid. And when a whole cross-language test suite is written by one person, you can be sure, that they don't really excel in many of those languages.
This is why I like Benchmark Game — all benchmarks are submitted by users, so they are a lot closer to how a real-world decent programmers can solve the problem. Still not perfect, but at least that counts as an attempt.
1: https://github.com/ixy-languages/ixy.java/blob/fcad50339e537...
2: https://github.com/ixy-languages/ixy.java/blob/fcad50339e537...
A full memory barrier is not required, but some languages only offer that. For example, go had the same problem. It's not a bottleneck because it goes to MMIO PCIe space which is super slow anyways (awaits a whole PCIe roundtrip).
And no, it obviously wasn't written by only one person but a team of 10.
No, we are not saying that we allocate for every packet. We say that we allocate 20 bytes on average per packet.
https://docs.oracle.com/javase/9/docs/api/java/lang/invoke/M...
The code is public, I'm sure they'd be happy to have your insight and fix this issue, it doesn't seem like they were happy about it.