Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
labels: eliminate most allocations and improve perf by 15-65% (miekg#…
…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
- Loading branch information
1 parent
dfadc3a
commit 08dd9d7
Showing
2 changed files
with
171 additions
and
114 deletions.
There are no files selected for viewing
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 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