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
labels: eliminate most allocations and improve perf by 15-65% #1007
Merged
Conversation
This file contains 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
This commit changes the labels functions to step through labels section-by-section instead of splitting them and thus allocating a slice. Where possible allocations are reduced to 0. ``` benchmark old ns/op new ns/op delta BenchmarkSplitLabels-12 41.4 34.9 -15.70% BenchmarkLenLabels-12 25.8 15.5 -39.92% BenchmarkCompareDomainName-12 107 39.3 -63.27% BenchmarkIsSubDomain-12 348 120 -65.52% benchmark old allocs new allocs delta BenchmarkSplitLabels-12 1 1 +0.00% BenchmarkLenLabels-12 0 0 +0.00% BenchmarkCompareDomainName-12 2 0 -100.00% BenchmarkIsSubDomain-12 6 0 -100.00% benchmark old bytes new bytes delta BenchmarkSplitLabels-12 32 32 +0.00% BenchmarkLenLabels-12 0 0 +0.00% BenchmarkCompareDomainName-12 64 0 -100.00% BenchmarkIsSubDomain-12 192 0 -100.00% ```
Codecov Report
@@ Coverage Diff @@
## master #1007 +/- ##
==========================================
+ Coverage 54.63% 54.72% +0.08%
==========================================
Files 41 41
Lines 9842 9857 +15
==========================================
+ Hits 5377 5394 +17
+ Misses 3438 3437 -1
+ Partials 1027 1026 -1
Continue to review full report at Codecov.
|
charlievieth
force-pushed
the
cev/labels-perf
branch
from
September 21, 2019 04:26
67550fb
to
df95aa5
Compare
miekg
approved these changes
Sep 21, 2019
miekg
added a commit
that referenced
this pull request
Oct 4, 2019
aanm
pushed a commit
to cilium/dns
that referenced
this pull request
Jul 29, 2022
…1007) * labels: eliminate most allocations and improve perf by 15-65% This commit changes the labels functions to step through labels section-by-section instead of splitting them and thus allocating a slice. Where possible allocations are reduced to 0. ``` benchmark old ns/op new ns/op delta BenchmarkSplitLabels-12 41.4 34.9 -15.70% BenchmarkLenLabels-12 25.8 15.5 -39.92% BenchmarkCompareDomainName-12 107 39.3 -63.27% BenchmarkIsSubDomain-12 348 120 -65.52% benchmark old allocs new allocs delta BenchmarkSplitLabels-12 1 1 +0.00% BenchmarkLenLabels-12 0 0 +0.00% BenchmarkCompareDomainName-12 2 0 -100.00% BenchmarkIsSubDomain-12 6 0 -100.00% benchmark old bytes new bytes delta BenchmarkSplitLabels-12 32 32 +0.00% BenchmarkLenLabels-12 0 0 +0.00% BenchmarkCompareDomainName-12 64 0 -100.00% BenchmarkIsSubDomain-12 192 0 -100.00% ``` * labels: fix CompareDomainName and improve tests
aanm
pushed a commit
to cilium/dns
that referenced
this pull request
Jul 29, 2022
…miekg#1007)" (miekg#1022) This reverts commit ab6ac40. This break CoreDNS tests and probably a lot of other apps as well. Reverted
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 commit changes the labels functions to step through labels section-by-section instead of splitting them and thus allocating a slice.
Where possible allocations are reduced to 0.