On Tuesday, 8 October 2013 at 17:55:33 UTC, Araq wrote:
O(1) malloc implementations exist, it is a solved problem.
(http://www.gii.upv.es/tlsf/)
custom allocator != generic malloc
In such conditions you almost always want to use incremental
region allocator anyway. Problem is hidden automatical allocation.
TLSF executes a maximum of 168 processor instructions in a x86
architecture. Saying that you can't use that during request
handling is like saying that you can't afford a cache miss.
Some time ago I have been working in a networking project where
request context was specifically designed to fit in a single
cache line and breaking this immediately resulted in 30-40%
performance penalty. There is nothing crazy about saying you
can't afford an extra cache miss. It is just not that common.
Same goes for avoiding heap allocations (but is much more common).