RFR: 8372701: Randomized profile counters [v2]
Andrew Haley
aph at openjdk.org
Mon Dec 15 10:40:39 UTC 2025
On Thu, 27 Nov 2025 17:56:45 GMT, Andrew Haley <aph at openjdk.org> wrote:
> One other thing that comes into mind: the initial swing from `0` -> `1` for a type counter is important, since `0` means "never seen the type at all", and `>0` means "maybe the type is present, however rare". I would suspect subsampling a small count to `0` would cause performance anomalies. Especially if, say, this anomaly causes a deopt - reprofile - compile cycle. It would doubly hurt, if _reprofile_ would miss the type _again_. Probably hard to do with RNG, but maybe we should be doing the initial counter seed on installation without consulting RNG.
I've been thinking about this some more, and I wonder how important it really is. Let's say we don't compile a method until it's been interpreted a couple of hundred times (it's at least 128). We're speculating that the call site is polymorphic, but so far has been called only monomorpically, so we need to check every invocation, just in case. I guess this does happen occasionally during some application warmup scenarios, but does it really matter? I guess we could try a big performance test suite to learn if with (say) 64-times decimation we see more recompilation.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28541#issuecomment-3654942036
More information about the hotspot-dev
mailing list