Commit fe7f039
publicsuffix: spruce up code gen and speed up PublicSuffix
Rely on functions from the slices package where convenient. Drop custom max functions in favor of max builtin. Remove unused non-exported functions.
Reduce the number of bounds checks. Replace calls to strings.LastIndex by calls to strings.LastIndexByte.
goos: darwin
goarch: amd64
pkg: golang.org/x/net/publicsuffix
cpu: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
│ old │ new │
│ sec/op │ sec/op vs base │
PublicSuffix-8 13.46µ ± 0% 13.23µ ± 0% -1.67% (p=0.000 n=20)
│ old │ new │
│ B/op │ B/op vs base │
PublicSuffix-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=20) ¹
¹ all samples are equal
│ old │ new │
│ allocs/op │ allocs/op vs base │
PublicSuffix-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=20) ¹
¹ all samples are equal
Change-Id: Id72967560884d98a5c0791ccea73dbb27d120c2c
GitHub-Last-Rev: 87567e7
GitHub-Pull-Request: #233
Reviewed-on: https://go-review.googlesource.com/c/net/+/652236
Reviewed-by: Damien Neil <[email protected]>
Commit-Queue: Ian Lance Taylor <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Michael Pratt <[email protected]>1 parent 459513d commit fe7f039
2 files changed
+28
-70
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 66 | | |
80 | 67 | | |
81 | 68 | | |
82 | 69 | | |
83 | 70 | | |
84 | 71 | | |
85 | 72 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 73 | | |
99 | 74 | | |
100 | 75 | | |
| |||
251 | 226 | | |
252 | 227 | | |
253 | 228 | | |
254 | | - | |
| 229 | + | |
255 | 230 | | |
256 | 231 | | |
257 | 232 | | |
| |||
509 | 484 | | |
510 | 485 | | |
511 | 486 | | |
512 | | - | |
| 487 | + | |
513 | 488 | | |
514 | 489 | | |
515 | 490 | | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
521 | 494 | | |
522 | 495 | | |
523 | 496 | | |
| |||
557 | 530 | | |
558 | 531 | | |
559 | 532 | | |
560 | | - | |
| 533 | + | |
561 | 534 | | |
562 | 535 | | |
563 | 536 | | |
| |||
586 | 559 | | |
587 | 560 | | |
588 | 561 | | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | 562 | | |
604 | 563 | | |
605 | 564 | | |
| |||
616 | 575 | | |
617 | 576 | | |
618 | 577 | | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
624 | 581 | | |
625 | 582 | | |
626 | 583 | | |
627 | 584 | | |
628 | | - | |
629 | | - | |
630 | | - | |
| 585 | + | |
| 586 | + | |
631 | 587 | | |
632 | 588 | | |
633 | 589 | | |
| |||
641 | 597 | | |
642 | 598 | | |
643 | 599 | | |
644 | | - | |
| 600 | + | |
645 | 601 | | |
646 | 602 | | |
647 | 603 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
203 | 205 | | |
0 commit comments