Glibc Enables A Per-Thread Cache For Malloc - Big Performance Win
Glibc has added a per-thread cache to malloc and enabled it by default.
The next glibc release should be exciting with this per-thread cache "tcache" added to the malloc() memory allocator function. This per-thread cache should be a big performance win and is described by the documentation as:
This new feature is being enabled by default unless --disable-experimental-malloc is passed at build time.
This should be fun for testing and benchmarking. This per-thread malloc cache will be present in the upcoming Glibc 2.26 release.
The next glibc release should be exciting with this per-thread cache "tcache" added to the malloc() memory allocator function. This per-thread cache should be a big performance win and is described by the documentation as:
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. Workloads were captured using a special instrumented malloc and analyzed with a malloc simulator.
This new feature is being enabled by default unless --disable-experimental-malloc is passed at build time.
This should be fun for testing and benchmarking. This per-thread malloc cache will be present in the upcoming Glibc 2.26 release.
33 Comments