-
Notifications
You must be signed in to change notification settings - Fork 18.4k
internal/profile: optimize Parse allocs #76145
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
Conversation
|
This PR (HEAD: a09108f) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/717081. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from Maksim Merzhanov: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from t hepudds: Patch Set 2: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from Go LUCI: Patch Set 2: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2025-11-02T11:51:48Z","revision":"137b22e6ae8f7af5b751069fb5b7ea1afd9bde56"} Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from t hepudds: Patch Set 2: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from Go LUCI: Patch Set 2: This CL has failed the run. Reason: Tryjob golang/try/gotip-windows-386 has failed with summary (view all results):
To reproduce, try Additional links for debugging: Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from Go LUCI: Patch Set 2: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from t hepudds: Patch Set 2: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from Go LUCI: Patch Set 2: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2025-11-02T12:15:52Z","revision":"137b22e6ae8f7af5b751069fb5b7ea1afd9bde56"} Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from t hepudds: Patch Set 2: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from Go LUCI: Patch Set 2: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from Go LUCI: Patch Set 2: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from Florian Lehner: Patch Set 2: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from Michael Pratt: Patch Set 2: Code-Review+2 (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from t hepudds: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
|
Message from Michael Knyszek: Patch Set 2: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/717081. |
In our case, it greatly improves the performance of continuously collecting diff profiles from the net/http/pprof endpoint, such as /debug/pprof/allocs?seconds=30. This CL is a cherry-pick of my PR upstream: google/pprof#951 Benchmark of profile Parse func: goos: linux goarch: amd64 pkg: github.com/google/pprof/profile cpu: 13th Gen Intel(R) Core(TM) i7-1360P │ old-parse.txt │ new-parse.txt │ │ sec/op │ sec/op vs base │ Parse-16 62.07m ± 13% 55.54m ± 13% -10.52% (p=0.035 n=10) │ old-parse.txt │ new-parse.txt │ │ B/op │ B/op vs base │ Parse-16 47.56Mi ± 0% 41.09Mi ± 0% -13.59% (p=0.000 n=10) │ old-parse.txt │ new-parse.txt │ │ allocs/op │ allocs/op vs base │ Parse-16 272.9k ± 0% 175.8k ± 0% -35.58% (p=0.000 n=10) Change-Id: I737ff9b9f815fdc56bc3b5743403717c4b6f07fd GitHub-Last-Rev: a09108f GitHub-Pull-Request: #76145 Reviewed-on: https://go-review.googlesource.com/c/go/+/717081 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
|
This PR is being closed because golang.org/cl/717081 has been merged. |
In our case, it greatly improves the performance of continuously collecting diff profiles from the net/http/pprof endpoint, such as /debug/pprof/allocs?seconds=30.
This CL is a cherry-pick of my PR upstream: google/pprof#951
Benchmark of profile Parse func:
goos: linux
goarch: amd64
pkg: github.com/google/pprof/profile
cpu: 13th Gen Intel(R) Core(TM) i7-1360P
│ old-parse.txt │ new-parse.txt │
│ sec/op │ sec/op vs base │
Parse-16 62.07m ± 13% 55.54m ± 13% -10.52% (p=0.035 n=10)
Parse-16 47.56Mi ± 0% 41.09Mi ± 0% -13.59% (p=0.000 n=10)
Parse-16 272.9k ± 0% 175.8k ± 0% -35.58% (p=0.000 n=10)