-
Notifications
You must be signed in to change notification settings - Fork 2.4k
go/types/objectpath: reduce allocations with sync.Pool #613
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
base: master
Are you sure you want to change the base?
Conversation
Use sync.Pool to reuse byte buffers and finder structs, reducing allocations by ~52% in heavy-usage scenarios. - Add pathBufPool for reusing path encoding buffers - Add smallInts lookup table for integers 0-99 - Add finderPool for reusing finder structs Benchmarking on a 9000-package monorepo with ~40 analyzers showed: - Allocations: 929MB → 445MB (52% reduction) - GC cycles: 21 → 14 (33% reduction) - GC pause time: 1.77ms → 0.81ms (54% reduction) Fixes golang/go#77059
|
This PR (HEAD: 0114d45) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/734140. Important tips:
|
|
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 Please don’t reply on this GitHub thread. Visit golang.org/cl/734140. |
|
Message from Daniel Morsing: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/734140. |
|
Message from Alan Donovan: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/734140. |
|
This PR (HEAD: 343bf99) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/734140. Important tips:
|
|
Message from Alan Donovan: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/734140. |
|
Message from Alan Donovan: Patch Set 2: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/734140. |
Use sync.Pool to reuse byte buffers and finder structs,
reducing allocations by ~52% in heavy-usage scenarios.
Benchmarking on a 9000-package monorepo with ~40 analyzers showed:
Fixes golang/go#77059