Skip to content
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

proposal: Go 2: support memory pool in context or thread for real request. just like ngx_pool_cleanup_t,ngx_pool_t in nginx. it can reduce gc and avoid lock #29091

Closed
buptbill220 opened this issue Dec 4, 2018 · 1 comment

Comments

@buptbill220
Copy link

What version of Go are you using (go version)?

$ go version 2

Does this issue reproduce with the latest release?

no

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

What did you expect to see?

What did you see instead?

@gopherbot gopherbot added this to the Proposal milestone Dec 4, 2018
@buptbill220 buptbill220 changed the title proposal: Go 2: support memory pool in context or thread for real request, avoid memory fragment proposal: Go 2: support memory pool in context or thread for real request. just like ngx_pool_cleanup_t,ngx_pool_t in nginx. it can reduce gc and avoid lock Dec 4, 2018
@ianlancetaylor
Copy link
Contributor

This is something that can be done outside of the Go standard library. Let's do it there first, and then see if it is useful. Closing this proposal.

Note that memory is already allocated from a per-thread cache. I don't see why using a pool would avoid locks. I agree that in some cases it might avoid a GC, but only with considerable care in management of the memory allocated from the pool.

@golang golang locked and limited conversation to collaborators Dec 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants