#683·mimalloc

mimalloc overhead vs baseline

Author: victorstewartCreated Jan 15, 2023Updated Sep 11, 2026
Labelsstale

not sure whether you've ever approached benchmarks from this perspective (vs. comparing to other allocators), but i've been benchmarking the convenience of using mimalloc for all allocations vs writing a custom arena or ring allocator for some memory patterns in my network server layer. i can share the code if you like, but below are the results... as just an FYI.

the pattern for each test is preallocate 1GB of memory (so either 1 1GB page, 512 2MB pages, or 262,144 4K pages), MAP_NORESERVE for all, MAP_POPULATE (this brought a huge speed up, but i tried it in mimalloc and saw no difference, weird) with the exception of the overcommitted 4K tests. also tried mimalloc without MAP_UNINITIALIZED and saw a performance cost, but added it to my mmap calls and saw 0 improvement, also weird. then of course the HUGE flags where appropriate. then do 100,000 same sized writes sequentially or randomly.

tests done on a Skylake chip (TLB numbers here https://www.7-cpu.com/cpu/Skylake.html)

IMG_7865

thought this reframing of the performance baseline might inspire some improvements

the conclusion of all this was i decided to just use mimalloc for these per client read/write network streams, than writing something custom myself right now, considering it's already a 32.11x performance improvement over the overcommitted random 4K memory model i had been using.