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

Projects
None yet
3 participants
@buptbill220
Copy link

buptbill220 commented Dec 4, 2018

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

@gopherbot gopherbot added the Proposal label 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

This comment has been minimized.

Copy link
Contributor

ianlancetaylor commented Dec 5, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment