[TraceQL] Reduce size of traceql Attribute struct and realign#5240
Merged
mdisibio merged 3 commits intografana:mainfrom Jun 9, 2025
Merged
[TraceQL] Reduce size of traceql Attribute struct and realign#5240mdisibio merged 3 commits intografana:mainfrom
mdisibio merged 3 commits intografana:mainfrom
Conversation
javiermolinar
approved these changes
Jun 9, 2025
| import "fmt" | ||
|
|
||
| type AttributeScope int | ||
| type AttributeScope int8 |
Contributor
There was a problem hiding this comment.
Nice is not byte more idiomatic?
Contributor
Author
There was a problem hiding this comment.
Usually I think of byte as arbitrary data. Here int8 reads as an enum with up to 256 values. If I saw a type aliased to byte I would expect custom parsing code relying on it somewhere. But happy to change if there if that approach is in wider use.
Contributor
There was a problem hiding this comment.
that's fine to me, I wasn't sure either
knylander-grafana
pushed a commit
that referenced
this pull request
Jun 11, 2025
* Reduce size of traceql Attribute struct and realign * changelog
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.
What this PR does:
This reduces the size of the
Attributestruct from 40 bytes to 24. Helps memory but the main benefit is faster performance around attributes in general (mapping/lookup/equality/etc). Most impactful for comparison queries because they have the most attribute processing, but a few % improvements across the board.Found this because during heavy reads, these operations are 5-10% of querier profiles.
Benchmark Search
Benchmark Metrics
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]