Why low-latency Java still requires discipline?
31–40 of 56 posts
Re: Why low-latency Java still requires discipline?
#32I get that blog posts often advertise a company's products, but this one had absolutely zero content other than advertising.
Re: Why low-latency Java still requires discipline?
#33How about not using Java? Then you can have low latency. Average go, rust, c++ and c will outperform amazing java programs, and the former will also be way way more easy to run, troubleshoot, interpret logs from. Java is usch garbage in every stack.
Re: Why low-latency Java still requires discipline?
#34Even C requires discipline to write low latency code, if you think otherwise, you never used a profiler.
Re: Why low-latency Java still requires discipline?
#35Even C requires discipline to write low latency code, if you think otherwise, you never used a profiler.
Yes. & in the end my experience has been that you can write low latency code with gc, but only by expending more effort than it'd take to use manual memory management
Secondly if we are talking about something like real time audio, or sending the maximum amount of triangles per second, then there is zero memory management, the code should be allocation free across all the critical path, regardless of the language.
Re: Why low-latency Java still requires discipline?
#36I get that blog posts often advertise a company's products, but this one had absolutely zero content other than advertising.
I think it said something very meaningful and actionable (admittedly at a high level) about keeping the hot path deterministic: low allocations (including guidelines for GC frequency targets), don't use vthreads (instead use one thread on a pcore that never sleeps, to avoid amdahl), caution about techiques that work at p99 and fail at 99.999... This is not typical for "enterprise" Java, and is an interesting article…
Re: Why low-latency Java still requires discipline?
#37I get that blog posts often advertise a company's products, but this one had absolutely zero content other than advertising.
Yes, disappointing given that Chronicle actually does have legit expertise here. (Chronicle Map is not very well-known even in the Java space but it's by far the best larger-than-memory Map available.)
Re: Why low-latency Java still requires discipline?
#38How about not using Java? Then you can have low latency. Average go, rust, c++ and c will outperform amazing java programs, and the former will also be way way more easy to run, troubleshoot, interpret logs from. Java is usch garbage in every stack.
Everyone that has a minimal experience with these knows it is not true.
While performance ceiling is likely higher in C/C++/Rust (but not Go), when we move beyond microbenchmarks Java provides competitive performance with much better ergonomics. Not to mention strictly superior tooling.
Re: Why low-latency Java still requires discipline?
#39How about not using Java? Then you can have low latency. Average go, rust, c++ and c will outperform amazing java programs, and the former will also be way way more easy to run, troubleshoot, interpret logs from. Java is usch garbage in every stack.
Re: Why low-latency Java still requires discipline?
#40Earlier quoted context omitted.
I need a UI which runs well on Windows, MacOS, and Linux, without having to build three different ones. Swing is still easily the best, most consistent, and most native-feeling cross-platform environment. It's much better than QT and GTK in most respects. And Java also runs elegantly on a little platform you may know as Android. I have high hopes for go and rust. But until they have mature UIs, they're out (for me).…
In heavily performance-engineered code having a GC coalesce memory is a pessimization in all cases. I've done a lot of performance engineering in both C++ and Java. Every optimization available in Java also exists in C++ but the reverse is not true, which is why C++ is always faster. Every example I have ever seen of Java being faster than C++ was just poorly optimized code. The heuristic I use is that heavily optimi…
@pron, who works on the JVM and is a C++ expert, has been writing a lot recently about low level languages becoming increasingly impossible to optimize with more LOC and more people working on it (dozens, or even hundreds of developers).
The idea being be a language with an aggressive JIT, moving garbage collector, and bump allocation is going to allocate/deallocte faster than malloc, and get the most important average optimizations at all times, where as the equivalent low level app will struggle to get the ideal allocation pattern the more people that work on it, or be forced to use slow dynamic dispatch. He wouldn't describe a GC as pessimistic, he'd say it's literally faster, and that's why he (a C++ programmer) works on it. The JVM was built by people saying "we are doing a handful of the same things in C++ all the time."
There are specific cases where it's good to have low level control, but they aren't everywhere.