[PATCH 0/9] malloc: Remove fastbins
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Wed Nov 26 20:38:20 GMT 2025
Hi Florian,
The batched frees look interesting! A few observations:
It halves the effective size of tcache for workloads that swap between
allocating and deallocating. A clear example is bench-malloc-simple
which becomes 32% slower overall. The geomean of xalancbmk and
omnetpp is ~1.7% slower. So it's not good for a tiny tcache (which by itself
is already an issue).
However with:
export GLIBC_TUNABLES=glibc.malloc.tcache_count=32:glibc.malloc.mxfast=0
bench-malloc-simple is 6.4% faster with batched frees (and 4.4% faster than the
original without the tunable). The geomean of xalancbmk and omnetpp is ~0.1%
slower with batched frees, but still 0.25% faster than default GLIBC.
So it works far better if you have larger tcache and no fastbins. What is not obvious
is where the tradeoff is, for example whether half the entries is best, a fixed number
or even something that tries to adapt (eg. empty tcache more if it repeatedly fills up
with freed blocks).
Cheers,
Wilco
More information about the Libc-alpha
mailing list