Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
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
What version of Go are you using (
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.