News for hackers. Stuff that matters.
Re:Performance of modern Java on data-heavy workloads by nicktelford on Tuesday June 09, 2020 @08:56AM (#23466218)
> If there was only a library that did date manipulation and arithmetic with longs instead of Instant :(

You can always pass around long timestamps and just convert to Instant whenever you need to do any date/time processing. Provided the Instant doesn't escape the method it's allocated in, it should be optimized via inlining and Scalar Replacement so that it doesn't generate garbage. Of course, you'd be adding in the overhead of dividing up your long in to seconds/nanos each time.

Note: if this doesn't work on OpenJDK, try GraalVM: it's Partial Escape Analysis should do a better job at finding ways of eliding heap allocations.

Re:Performance of modern Java on data-heavy workloads by haxen on Tuesday June 09, 2020 @09:05AM (#23466306)
The worst things happen when value objects are stuck on the heap for a while and then turn into garbage when the value is updated. Escape Analysis doesn't help there, only a good GC can help.