-
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
publicsuffix: spruce up code gen and speed up PublicSuffix #233
Conversation
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
This PR (HEAD: 87567e7) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/net/+/652236. Important tips:
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/652236. |
Message from Damien Neil: Patch Set 3: Commit-Queue+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/652236. |
Message from Go LUCI: Patch Set 3: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2025-02-28T00:46:01Z","revision":"b4bf6cf9dbd3253cdf70efa4ada1706819e3638b"} Please don’t reply on this GitHub thread. Visit golang.org/cl/652236. |
Message from Damien Neil: Patch Set 3: Code-Review+2 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/652236. |
Message from Damien Neil: Patch Set 3: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/652236. |
Message from Go LUCI: Patch Set 3: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/652236. |
Message from Go LUCI: Patch Set 3: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/652236. |
Message from Michael Pratt: Patch Set 3: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/652236. |
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 <dneil@google.com> Commit-Queue: Ian Lance Taylor <iant@golang.org> Auto-Submit: Ian Lance Taylor <iant@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com>
This PR is being closed because golang.org/cl/652236 has been merged. |
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)
PublicSuffix-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=20) ¹
¹ all samples are equal
PublicSuffix-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=20) ¹
¹ all samples are equal