Re:Sub-10 ms Latency in Java: Concurrent GC with Green Threads
by twic on Wednesday August 05, 2020 @09:31AM
(#24060538)
They're good enough for some purposes, but not for others. If you need <10 us latency, you still have to jump through hoops to get that on a JVM.
[ Parent
| on HN ]
Re:Sub-10 ms Latency in Java: Concurrent GC with Green Threads
by haxen on Wednesday August 05, 2020 @10:40AM
(#24061271)
For < 10 µs latency there are hoops in any language, as well as the OS, like thread-pinning, marking CPU cores unusable for OS interrupt handling, all kinds of virtual memory issues, etc. And you can't afford a single network hop or even SSD access.
Re:Sub-10 ms Latency in Java: Concurrent GC with Green Threads
by twic on Wednesday August 05, 2020 @01:36PM
(#24063354)
True! It's not trivial to get 10 us latency even in C++, Rust, etc. You have to do OS-level configuration, and you can't touch network or disk.
But beyond that, the actual code you write is fairly natural for those languages. You can't allocate, and your code and data have to fit in the cache. But you can use normal language constructs, and most of the standard library - neither of which is true for Java.
Re:Sub-10 ms Latency in Java: Concurrent GC with Green Threads
by Erlich_Bachman on Wednesday August 05, 2020 @10:49AM
(#24061398)
And yet 90% of time we hear about this latency problems when speaking about a language, it's always about JVM... When it would be equally hard in any other dynamic language... What gives...
Re:Sub-10 ms Latency in Java: Concurrent GC with Green Threads
by vips7L on Wednesday August 05, 2020 @11:16AM
(#24061731)
I don't know of any other runtime that gives you the tools to tune your latency and the GC other than the JVM.
Re:Sub-10 ms Latency in Java: Concurrent GC with Green Threads
by exdsq on Wednesday August 05, 2020 @11:38AM
(#24062011)
GHC (Haskell)?
Re:Sub-10 ms Latency in Java: Concurrent GC with Green Threads
by saberience on Wednesday August 05, 2020 @11:31AM
(#24061932)
Err Dotnet? :)
Re:Sub-10 ms Latency in Java: Concurrent GC with Green Threads
by therealdrag0 on Wednesday August 05, 2020 @12:23PM
(#24062576)
Might be a side affect of Java’s dominance/popularity.
Re:Sub-10 ms Latency in Java: Concurrent GC with Green Threads
by PaulDavisThe1st on Wednesday August 05, 2020 @01:07PM
(#24063072)
>And you can't afford a single network hop or even SSD access.
10µs ? You can't even afford that many function calls.
Seriously, 10µs is not a sensible target for a general purpose OS, maybe not even for a general purpose CPU. Achievable? Perhaps. But sensible? Not really.
Re:Sub-10 ms Latency in Java: Concurrent GC with Green Threads
by rowanG077 on Wednesday August 05, 2020 @02:13PM
(#24063787)
That's really insanity to me. 10µs is a goddamn long time for a modern computer. That's 30000 clock cycles for a 3Ghz CPU. Each clock cycle can handle multiple instruction. It should be trivial to handle most light computations in this time as long as you ensure the data is in cache.
Re:Sub-10 ms Latency in Java: Concurrent GC with Green Threads
by PaulDavisThe1st on Wednesday August 05, 2020 @08:20PM
(#24067015)
That's a very fair point. I suppose I'm too used to the idea that the code which runs with sub-N-µs latency is going to process a "lot" of data, and that there's no way it will all be in the cache (any cache).
I suppose that if you're working on small amounts of data every time your code executes, then this becomes vastly more reasonable.