Repository navigation
Conversation
ultrotter
force-pushed
the
labelset-fingerprint-buf64
branch
from
November 24, 2026 08:31
6c8370d to
f92c508
Compare
Add a 64-name stack buffer for sets of 33 to 64 labels, kept in a
separate non-inlined frame so that the common path up to 32 labels does
not reserve it. The collect, sort and hash loop moves into a shared
hashLabelNames that takes the buffer, or the heap slice for larger sets,
as an argument.
Frame locals: labelsToFingerprint 712 bytes plus hashLabelNames 336,
against 968 before, and labelsToFingerprintLarge 1088 only on its path.
benchstat n=10, labelset-subset-fingerprint tip vs this, binaries run
interleaved:
before after
MetricToFingerprintTriple 173.3n ± 1% 175.7n ± 0% +1.33% (p=0.001)
MetricToFingerprintTwenty 1.118µ ± 3% 1.118µ ± 1% ~ (p=0.590)
MetricToFingerprintThirtyThree 2.250µ ± 3% 2.004µ ± 1% -10.91% (p=0.000) 1 -> 0 allocs
MetricToFingerprintSixtyFour 5.457µ ± 3% 4.913µ ± 2% -9.96% (p=0.000) 1 -> 0 allocs
LabelSetFingerprintForLabels 97.31n ± 0% 94.53n ± 0% -2.86% (p=0.000)
Signed-off-by: Guido Trotter <guido@hudson-trading.com>
ultrotter
force-pushed
the
labelset-fingerprint-buf64
branch
from
November 24, 2026 08:33
f92c508 to
70fb198
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is based on #1049 and uses a new in-between function to optimize the 64-labels case without impacting the smaller ones. Sending separately as it might not be necessarily worth it, but up to us if we merge it or not.