Skip to content

Skip id normalization for existing meters - #1299

Merged
brharrington merged 1 commit into
mainfrom
dannyt/skip-meter-normalization-on-hit
Sep 22, 2026
Merged

brharrington merged 1 commit into
mainfrom
dannyt/skip-meter-normalization-on-hit

Conversation

@DanielThomas

@DanielThomas DanielThomas commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

I was running some profiles against Images and Supermarket and found that Id normalisation was a hotspot. Avoiding this work should give a small but noticeable improvement to CPU utilisation from Spectator.

Benchmark

JDK 25, one thread, two forks:

Benchmark                                      Before       After       Change
CounterIncrement.lookupCost                    32.1 M/s     133.0 M/s   4.1x
CounterIncrement.taggedLookupCost               7.10 M/s    119.5 M/s  16.8x
CounterIncrement.invalidLookupCost              4.37 M/s      4.59 M/s  no regression

Allocation is unchanged: 40 B/op for valid lookups and 304 B/op for the invalid-id normalization path. The allocation is the SwapCounter returned from each registry lookup plus, for the invalid case, the normalized id.

@DanielThomas
DanielThomas marked this pull request as ready for review September 22, 2026 07:28
@brharrington brharrington added this to the 1.10.8 milestone Sep 22, 2026
@brharrington
brharrington merged commit 7feea13 into main Sep 22, 2026
1 check passed
@brharrington
brharrington deleted the dannyt/skip-meter-normalization-on-hit branch September 22, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants