Commit Graph

8 Commits

Author SHA1 Message Date
Aliaksey Kandratsenka 90eff0637b upgrade malloc bench away from std::random_shuffle
C++17 dropped it, so we use C++11 and later std::shuffle
instead. Fixes github issue #1378
2023-07-02 21:28:30 -04:00
Aliaksey Kandratsenka b501806f2a fix malloc_bench on clang
We got bitten again by compiler optimizing out free(malloc(sz))
combination. We replace calls to malloc/free with calls to global
function operator new/delete. Those are apparently forbidden by
standard to be optimized out.
2023-07-02 21:28:30 -04:00
Aliaksey Kandratsenka 8b9728b023 add memalign benchmark to malloc_bench 2017-11-30 18:14:11 +00:00
Aliaksey Kandratsenka a2550b6309 turn bench_fastpath_throughput into actual throughput benchmark
Previously we bumped size by 16 between iterations, but for many size
classess that gave is subsequent iteration into same size
class. Multiplying by prime number randomizes sizes more so speeds up
this benchmark on at least modern x86.
2017-05-14 19:04:55 -07:00
Aliaksey Kandratsenka b762b1a492 added sized free benchmarks to malloc_bench 2017-05-14 19:04:55 -07:00
Aliaksey Kandratsenka 71ffc1cd6b added free lists randomization step to malloc_bench 2017-05-14 19:04:55 -07:00
Aliaksey Kandratsenka 962aa53c55 added more fastpath microbenchmarks
This also makes them output nicer results. I.e. every benchmark is run 3
times and iteration duration is printed for every run.

While this is still very synthetic and unrepresentave of malloc performance
as a whole, it is exercising more situations in tcmalloc fastpath. So it a
step forward.
2015-10-17 20:34:19 -07:00
Aliaksey Kandratsenka 64e0133901 added trivial malloc fast-path benchmark
While this is not good representation of real-world production malloc
behavior, it is representative of length (instruction-wise and well as
cycle-wise) of fast-path. So this is better than nothing.
2015-08-02 16:53:19 -07:00