RFR: 8372701: Randomized profile counters [v2]
Andrew Haley
aph at openjdk.org
Mon Dec 15 13:44:31 UTC 2025
On Mon, 15 Dec 2025 11:13:27 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> To your example: indeed, there is no recourse in case when really-polymorphic site is accidentally looking monomorphic due to code behavior artifacts: e.g. no one came with rare type just yet. But IMO that does not mean we would be opening more performance trap-doors when some code _did_ come with the rare type, especially if it is easy to handle.
Thanks for this input, it helps a lot.
How cheap it is always to update type profile counters depends on how many threads are racily updating them. But it's easy to move type-profiling code from behind the random step to in front of it, so I'll make that change.
> The fact that some of your horses might have bolted, does not give you a good reason to open the barn door a bit wider
Agree totally in principle, but that analogy only works if the cost of closing the door is near-zero. It may well be so, we'll see.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28541#issuecomment-3655712779
More information about the hotspot-dev
mailing list