Home

Awesome

<img align="left" width="100" height="100" src="doc/mimalloc-logo.png"/>

Mimalloc-bench

 

Suite for benchmarking malloc implementations, originally developed for benchmarking mimalloc. Collection of various benchmarks from the academic literature, together with automated scripts to pull specific versions of benchmark programs and allocators from Github and build them.

Due to the large variance in programs and allocators, the suite is currently only developed for Unix-like systems, and specifically Ubuntu with apt-get, Fedora with dnf, and macOS (for a limited set of allocators and benchmarks). The only system-installed allocator used is glibc's implementation that ships as part of Linux's libc. All other allocators are downloaded and built as part of build-bench-env.sh -- if you are looking to run these benchmarks on a different Linux distribution look at the setup_packages function to see the packages required to build the full set of allocators.

It is quite easy to add new benchmarks and allocator implementations -- please do so!.

Enjoy, Daan

Note that all the code in the bench directory is not part of mimalloc-bench as such, and all programs in the bench directory are governed under their own specific licenses and copyrights as detailed in their README.md (or license.txt) files. They are just included here for convenience.

Benchmarking

The build-bench-env.sh script with the all argument will automatically pull all needed benchmarks and allocators and build them in the extern directory:

~/dev/mimalloc-bench> ./build-bench-env.sh all

It starts installing packages and you will need to enter the sudo password. All other programs are build in the mimalloc-bench/extern directory. Use ./build-bench-env.sh -h to see all options.

If everything succeeded, you can run the full benchmark suite (from out/bench) as:

Or just test mimalloc and tcmalloc on cfrac and larson with 16 threads:

Generally, you can specify the allocators (mi, je, tc, hd, sys (system allocator)) etc, and the benchmarks , cfrac, espresso, barnes, lean, larson, alloc-test, cscratch, etc. Or all allocators (alla) and tests (allt). Use --procs=<n> to set the concurrency, and use --help to see all supported allocators and benchmarks.

Current Allocators

Supported allocators are as follow, see build-bench-env.sh for the versions:

Current Benchmarks

The first set of benchmarks are real world programs, or are trying to mimic some, and consists of:

The second set of benchmarks are stress tests and consist of:

Finally, there is a security benchmark aiming at checking basic security properties of allocators.

Example

Below is an example (Apr 2019) of the benchmark results on an HP Z4-G4 workstation with a 4-core Intel® Xeon® W2123 at 3.6 GHz with 16GB ECC memory, running Ubuntu 18.04.1 with LibC 2.27 and GCC 7.3.0.

bench-z4-1 bench-z4-2

Memory usage:

bench-z4-rss-1 bench-z4-rss-2

(note: the xmalloc-testN memory usage should be disregarded is it allocates more the faster the program runs. Unfortunately, there are no entries for SuperMalloc in the leanN and xmalloc-testN benchmarks as it faulted on those)

Results and notable usages

Improvements

Notable usages

References