Well, at the limits of performance, you&#x27;re still looking at additional copies to get the cached data from the cache to the program, then probably another copy to get it from the input to the output, plus several context switches (which, even if they may ultimately have a relatively small effect on throughput, will increase latency). Having it in-process can be faster, if you&#x27;re willing to pay the complexity price.<p>Again, it&#x27;s almost certainly premature optimization to start with that design, but if that&#x27;s where your optimization leads you, it&#x27;s not that surprising.<p>FWIW, I wrote something myself that hits a similar problem, but in a completely different dimension: <a href="https:&#x2F;&#x2F;github.com&#x2F;thejerf&#x2F;gomempool" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;thejerf&#x2F;gomempool</a> <i>My</i> problem was that I had an otherwise rather placid program (from an allocation perspective) that liked to allocate buffers for messages that were many hundreds of kilobytes to low numbers of megabytes in size. In normal usage, only maybe one or two of these are ever in use at a time, but I use hundreds per second. In my case, each individual GC was actually not that big a deal, but I was triggering them every few seconds. The GC would see a lot of large allocs, and then <i>successfully</i> clean them up, meaning that the next batch of large allocations would be seen as crossing the threshold again. My stats clearly showed that on this system, once I started pooling my []byte I never even filled up the memory pool itself, and my GCs plummeted so far that I wouldn&#x27;t even particularly care if they took half-a-second apiece anymore, which they don&#x27;t. Almost everything other than those large message buffers were stack-alloc&#x27;ed anyhow.