TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Performance of modern Java on data-heavy workloads

202 pointsby cangenceralmost 5 years ago

6 comments

willvarfaralmost 5 years ago
A very clear and interesting post.<p>I&#x27;ve been trying to fit big-enough long-running stuff into JVMs for a few years, and have found that minimizing the amount of garbage is paramount. Its a bit like games- or C programming.<p>Recent JVM features like 8-bit strings and not having a size-limit on the interned pools etc have been really helpful.<p>But, for my workloads, the big wastes are still things like java.time.Instant and the overhead of temporary strings (which, these days, copy the underlying data. My code worked better when split strings used to just be views).<p>There are collections for much more memory-efficient (and faster) maps and things, and also efficient (and fast) JSON parsing etc. I have evaluated and benchmarked and adopted a few of these kinds of things.<p>Now, when I examine heap-dumps and try and work out where more I can save bytes to keep GC at bay, I mostly see fragments of Instant and String, which are heavily used in my code.<p>If there was only a library that did date manipulation and arithmetic with longs instead of Instant :(
评论 #23466218 未加载
评论 #23471222 未加载
评论 #23466296 未加载
评论 #23466725 未加载
评论 #23466456 未加载
blinkingledalmost 5 years ago
I wonder how things would have stacked with OpenJ9 - AdoptOpenJDK project makes OpenJ9 builds available for Java 8&#x2F;11&#x2F;13&#x2F;14 - so it should be trivial to include it in the benchmarks.<p>We have been experimenting with it in light of the Oracle licensing situation and it does provide interesting set of options - AOT, various GCs (metronome, gencon, balanced) along with many other differentiators to OpenJDK like JITServer which offloads JIT compilation to remote nodes.<p><a href="https:&#x2F;&#x2F;www.eclipse.org&#x2F;openj9&#x2F;docs&#x2F;gc&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.eclipse.org&#x2F;openj9&#x2F;docs&#x2F;gc&#x2F;</a><p>It doesn&#x27;t get as much coverage when it should - it&#x27;s production hardened - IBM has used it and still uses it for all their products - and it&#x27;s fully open source.
评论 #23471342 未加载
molodecalmost 5 years ago
Specific workload matter a lot. I had a good experience with Shenandoah collector on an application that generates very few intermediate objects, but once an object is created it stays in the heap for a while ( a custom made key&#x2F;value store for a very specific use case). Shenandoah collector was the best in terms of throughput and memory utilization. Most collectors are generational, so surviving objects have to be moved from Eden to Survivor to Old. Shenandoah is not generational, and I suspect it has less work to do for objects that survive compare to other collectors. When most objects live long enough generational collectors hinder performance.
评论 #23467727 未加载
评论 #23468131 未加载
ww520almost 5 years ago
G1 looks very good. Glad it becomes the default so one less thing to tune for a deployment.
cangenceralmost 5 years ago
Follow-up post: <a href="https:&#x2F;&#x2F;jet-start.sh&#x2F;blog&#x2F;2020&#x2F;06&#x2F;23&#x2F;jdk-gc-benchmarks-rematch" rel="nofollow">https:&#x2F;&#x2F;jet-start.sh&#x2F;blog&#x2F;2020&#x2F;06&#x2F;23&#x2F;jdk-gc-benchmarks-remat...</a>
xvilkaalmost 5 years ago
Converting Java code to Kotlin, then compiling it with the Kotlin Native[1] is more promising from the performance point of view. Native code is always faster (assuming compiler is good enough).<p>[1] <a href="https:&#x2F;&#x2F;kotlinlang.org&#x2F;docs&#x2F;reference&#x2F;native-overview.html" rel="nofollow">https:&#x2F;&#x2F;kotlinlang.org&#x2F;docs&#x2F;reference&#x2F;native-overview.html</a>
评论 #23470538 未加载