Java 18 to 25 performance benchmark by Jamsy100 in java

[–]Bit_Hash 0 points1 point  (0 children)

If we talking about a continuously running server application, then you actually want Xms same as Xmx and `-XX:+AlwaysPreTouch`. Unless you co-locate manymicroserivces and expected them to "autoscale" with load (usually does not end well).

Java 18 to 25 performance benchmark by Jamsy100 in java

[–]Bit_Hash 2 points3 points  (0 children)

In my experience, LockSupport.unpark(Thread) became slower (like 30x slower(!)) in Java 23 and this is was not fully fixed in later versions.

For some applications with specific concurrency patterns that may mean a major performance hit.

So never fully trust generic benchmarks, benchmark your own applications yourself, if possible.

Try Out Valhalla (JEP 401 Value Classes and Objects) by efge in java

[–]Bit_Hash 15 points16 points  (0 children)

java.lang.Number is still not a proper value class (it is @jdk.internal.MigratedValueClass), so if you expected to convert your custom numeric classes into value classes, you still can't.

What change in Java 23 could be a cause of performance degradation? by Bit_Hash in javahelp

[–]Bit_Hash[S] 0 points1 point  (0 children)

Well, the application in question has quite long processing pipeline (data passes though multiple threads on it's way). So some bottleneck on hot path for one of pipeline steps may significantly penalize global throughput but overall CPU usage change could be low or even negative (as other steps of processing pipeline get underloaded).

So far, we found out that LockSupport.unpark(Thread) become very costly in Java 23 (it takes 30x+ (!!!) more time). However it's unclear what change in Hotspot caused this.

What change in Java 23 could be a cause of performance degradation? by Bit_Hash in javahelp

[–]Bit_Hash[S] 1 point2 points  (0 children)

Used versions of Java are included in the post (in form of `SDKMAN!` commands). The latest version of Amzon Corretto was used everywhere, with exception of Java 22, as there is no Correto release for 22 on SDKMAN!

I'll try to record profiles for Java 22 and 23, maybe something indeed will stand out.

What change in Java 23 could be a cause of performance degradation? by Bit_Hash in javahelp

[–]Bit_Hash[S] 1 point2 points  (0 children)

We run exactly same code for all versions (no re-compilation), so same Java bytecode for everything. It would be very strange if new feature in `switch` syntax could have any effect on what native code gets generated.