-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg/trace/agent: consider UTF-8 characters in tags #2957
Conversation
This change fixes a problem in NormalizeTag where it was assuming character lengths to be always equal to 1, whereas this isn't always true for UTF-8 characters. It also fixes an issue where not all Unicode letters were lower-cased. Performance remains virtually unimpacted. name old time/op new time/op delta NormalizeTag/ok-4 68.8ns ± 0% 69.2ns ± 0% +0.58% NormalizeTag/trim-4 92.8ns ± 0% 92.5ns ± 0% -0.32% NormalizeTag/trim-both-4 159ns ± 0% 163ns ± 0% +2.52% NormalizeTag/plenty-4 147ns ± 0% 150ns ± 0% +2.04% NormalizeTag/more-4 259ns ± 0% 270ns ± 0% +4.25% name old alloc/op new alloc/op delta NormalizeTag/ok-4 24.0B ± 0% 24.0B ± 0% 0.00% NormalizeTag/trim-4 32.0B ± 0% 32.0B ± 0% 0.00% NormalizeTag/trim-both-4 64.0B ± 0% 64.0B ± 0% 0.00% NormalizeTag/plenty-4 64.0B ± 0% 64.0B ± 0% 0.00% NormalizeTag/more-4 128B ± 0% 128B ± 0% 0.00% name old allocs/op new allocs/op delta NormalizeTag/ok-4 2.00 ± 0% 2.00 ± 0% 0.00% NormalizeTag/trim-4 2.00 ± 0% 2.00 ± 0% 0.00% NormalizeTag/trim-both-4 3.00 ± 0% 3.00 ± 0% 0.00% NormalizeTag/plenty-4 3.00 ± 0% 3.00 ± 0% 0.00% NormalizeTag/more-4 4.00 ± 0% 4.00 ± 0% 0.00%
Codecov Report
@@ Coverage Diff @@
## master #2957 +/- ##
==========================================
+ Coverage 56.53% 56.54% +0.01%
==========================================
Files 484 484
Lines 34250 34260 +10
==========================================
+ Hits 19362 19373 +11
+ Misses 13727 13726 -1
Partials 1161 1161
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests say it all I think. GTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks Alex! Great learnings here! 😄 |
This change fixes a problem in NormalizeTag where it was assuming character lengths to be always equal to 1, whereas this isn't always true for UTF-8 characters.
It also fixes an issue where not all Unicode letters were lower-cased.
Performance remains virtually unimpacted.
In addition to #2951