2 ms·
> ... small slice and find some payloads append large amounts, write your own append that preemptively is more aggressive in cap bumping before calling the buil
by ignoramous 2y ago
> ... small slice and find some payloads append large amounts, write your own append that preemptively is more aggressive in cap bumping before calling the builtin append ...
gVisor netstack (userspace TCP/IP) uses a copy-on-write, reference-counted, tiered-pool for their arena-like alloc needs: https://gvisor.dev/blog/2022/10/24/buffer-pooling/ https://gvisor.dev/blog/2022/10/24/buffer-pooling/ / https://archive.vn/YzB1C https://archive.vn/YzB1C
The downside of their approach is, the client code is no longer dealing with just []byte (although, both the View and the Buffer type can vend out []bytes).