JDK 8 great performance increase on ByteBuffer read performance!?
cleber at nightcoders.com.br
Mon Apr 7 15:15:18 UTC 2014
Hello, I'm curious to know if there has been any low-level optmizations
regarding direct buffers getXXX methods on JDK8 and, if they're planned to
be integrated in JDK7, if applicable. I googled and took a look at the bug
database but I couldn't find anything related.
I have a microbenchmark that does millions of iterations serializing and
deserializing objects to/from ByteBuffers and I noticed that read
performance on JDK 8 has increased by almost 45% in comparison to earliear
JDK 7 releases in the serial case and more than 200% on the concurrent
case! I think that the concurrent test is perhaps benefiniting from newer
ForkJoinPool/concurrency code, but the difference in the serial case is
still very large!
Bellow are the VM arguments that I'm using for the test:
$JAVA -server -XX:+UseParallelGC \
-XX:+UseLargePages -XX:MaxDirectMemorySize=10G -Xmx1g -XX:MaxInlineSize=256
-XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining -XX:+LogCompilation
JDK8 seems to generate much more compiling information than the previous
versions, but I wasn't able to find any indicators for such huge
Here are the test results (collected with the diagnostic flags off, on a HP
G7 48 CPU box).
503K Reads/s|Writes/s 161K (jdk7U10)
940K Reads/s|Writes/s 165K (jdk7U40)
956K Reads/s|Writes/s 159K (jdk7U60 EA)
1644K Reads/s|Writes/s 172K (jdk8-more than 3x faster than U10!)
137K Reads/s|Writes/s 146K
145K Reads/s|Writes/s 145K
143K Reads/s|Writes/s 155K
198K Reads/s|Writes/s 172K
Upon deserialization the test does a lot of short-lived allocations, but GC
reports show very similar results for every JDK versions used in the test
(about ~500 Young Gen Collections and ~1800ms spent by PS Scavenge).
Anyway, great work!!! I hope I can migrate to JDK8 as soon as possible.
More information about the hotspot-dev