3 ms·
> A per-thread cache has been added to malloc. Access to the cache requires no locks and therefore significantly accelerates the fast path to allocate and free
by JoshTriplett 9y ago
> A per-thread cache has been added to malloc. Access to the cache requires no locks and therefore significantly accelerates the fast path to allocate and free small amounts of memory. Refilling an empty cache requires locking the underlying arena. Performance measurements show significant gains in a wide variety of user workloads.
This is major, and makes glibc's malloc competitive with (or better than) alternative mallocs like jemalloc. See https://openbenchmarking.org/result/1708052-TY-REDISMALL91 https://openbenchmarking.org/result/1708052-TY-REDISMALL91 for benchmark numbers.