In order to cut down on vector allocations, I would like to find something like Go’s sync.Pool. Ideally I could create a static value using the
lazy_static! macro and just get and put vectors when needed. I am okay with calling
reset on the vectors when fetching them as this seems to be a common pattern.
So far I came across the pool crate which seemed ideal but it uses the
Drop trait to put values back in whereas I would like explicit control. This is because the vector may be moved across functions many times.
Thanks for reading!