Skip to content

Comment on Generic Freelist Allocator for Goparent

Comments

I actually only use sync.Pool to allocate large chunks at a time, so the cost of sync.Pool calls is minimal. The main benefit comes from allocating (and freeing) the big chunk instead of individual structs, without having to worry about object lifetimes.

Correction: no, looks like I do indeed call it each time. Well, it's still more efficient I guess :))

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.