Skip to content

f18m/malloc-benchmarks

Repository files navigation

malloc-benchmarks

Simple benchmarking scripts to run on any machine to compare different C/C++ malloc implementations. The scripts are not meant to face any possible problem, quite the opposite. They will:

  • download and build GNU libc, Google perftools, Jemalloc
  • use GNU libc malloc multi-thread benchmarking utility to generate JSON results for different combinations of malloc implementation and number of threads
  • use Python matplotlib to produce a summary figure

How to collect benchmark results and view them

   git clone https://github.com/f18m/malloc-benchmarks.git
   cd malloc-benchmarks
   make

How to collect benchmark results on a machine and plot them from another one

On the machine where you want to collect benchmark results:

   git clone https://github.com/f18m/malloc-benchmarks.git
   cd malloc-benchmarks
   make download build collect_results 
   scp -r results IP_OF_OTHER_MACHINE:

On the other machine where you want to plot results:

   git clone https://github.com/f18m/malloc-benchmarks.git
   cd malloc-benchmarks
   mv ../results .
   make plot_results

Example benchmarks

The following are some pictures obtained on different HW systems using however the same benchmarking utility written by GNU libc developers. They give an idea on how much performances can be different on different CPU/memory HW and varying the number of threads. Of course the closer the curves are to zero, the better they are (the lower the better!).

Relevant HW information of machine used for testing available here

'system_default' is GNU libc version 2.23 (default for Ubuntu 16.04 LTS)

'glibc' is GNU libc version 2.26

'tcmalloc' is Google gperftools version 2.6.3

'jemalloc' is Google gperftools version 5.0.1

Relevant HW information of machine used for testing available here

'system_default' is GNU libc version 2.23 (default for Ubuntu 16.04 LTS)

'glibc' is GNU libc version 2.26

'tcmalloc' is Google gperftools version 2.6.3

'jemalloc' is Google gperftools version 5.0.1

Relevant HW information of machine used for testing available here

'system_default' is GNU libc version 2.17 (default for Centos 7)

'glibc' curve is missing: the default GCC of Centos 7 is too old to build a recent GNU libc version.

'tcmalloc' is Google gperftools version 2.6.3

'jemalloc' is Google gperftools version 5.0.1

Contribute your own benchmarks

If you would like to contribute your benchmarks running on different hardware please contact me at francesco DOT montorsi AT gmail DOT com. Thanks.

About

Simple benchmarking scripts to run on any machine to compare different C/C++ malloc implementations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published