Go nearly had Arenas a few years ago. And I think they are still used in Google. But they were pulled because the polluted the API's of too many libraries. See https://github.com/golang/go/issues/51317 On Thursday, 27 February 2025 at 07:55:27 UTC will....@gmail.com wrote:
> I recently recalled that someone in the Go Team—I forget who—said that the > Go compiler slowed down a lot after converting from C to Go because the Go > GC was freeing a lot of memory that the C code wasn't. > > I wonder if an approach like that of memory regions ( > https://github.com/golang/go/discussions/70257) could be used to hint to > the GC that memory allocated in a function doesn't need to be freed unless > there is severe memory pressure. > > For example (for lack of a better name): > > func main() { > runtime.DeferCollection(func() { > runCommand() > }) > } > > Will > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/2ebe77c1-7d62-4e5f-b300-1165e99cd477n%40googlegroups.com.