Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use golang.org/x/exp/slices.SortFunc to avoid an allocation.
goos: darwin goarch: arm64 pkg: github.com/munnerz/goautoneg │ original.txt │ step-2-slices-sort.txt │ │ sec/op │ sec/op vs base │ ParseAccept/#00-10 24.445n ± 0% 6.524n ± 0% -73.31% (p=0.002 n=6) ParseAccept/application/json-10 90.67n ± 1% 65.66n ± 0% -27.58% (p=0.002 n=6) ParseAccept/application/json,text/plain-10 152.7n ± 1% 125.3n ± 0% -17.94% (p=0.002 n=6) ParseAccept/application/json;q=0.9,text/plain-10 214.5n ± 0% 188.1n ± 0% -12.28% (p=0.002 n=6) ParseAccept/application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5-10 636.6n ± 1% 615.6n ± 1% -3.30% (p=0.002 n=6) geomean 135.8n 90.93n -33.05% │ original.txt │ step-2-slices-sort.txt │ │ B/op │ B/op vs base │ ParseAccept/#00-10 24.00 ± 0% 0.00 ± 0% -100.00% (p=0.002 n=6) ParseAccept/application/json-10 72.00 ± 0% 48.00 ± 0% -33.33% (p=0.002 n=6) ParseAccept/application/json,text/plain-10 120.00 ± 0% 96.00 ± 0% -20.00% (p=0.002 n=6) ParseAccept/application/json;q=0.9,text/plain-10 168.0 ± 0% 144.0 ± 0% -14.29% (p=0.002 n=6) ParseAccept/application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5-10 456.0 ± 0% 432.0 ± 0% -5.26% (p=0.002 n=6) geomean 109.7 ? ¹ ² ¹ summaries must be >0 to compute geomean ² ratios must be >0 to compute geomean │ original.txt │ step-2-slices-sort.txt │ │ allocs/op │ allocs/op vs base │ ParseAccept/#00-10 1.000 ± 0% 0.000 ± 0% -100.00% (p=0.002 n=6) ParseAccept/application/json-10 2.000 ± 0% 1.000 ± 0% -50.00% (p=0.002 n=6) ParseAccept/application/json,text/plain-10 2.000 ± 0% 1.000 ± 0% -50.00% (p=0.002 n=6) ParseAccept/application/json;q=0.9,text/plain-10 3.000 ± 0% 2.000 ± 0% -33.33% (p=0.002 n=6) ParseAccept/application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5-10 5.000 ± 0% 4.000 ± 0% -20.00% (p=0.002 n=6) geomean 2.268 ? ¹ ² ¹ summaries must be >0 to compute geomean ² ratios must be >0 to compute geomean
- Loading branch information