cloudflare / cf_benchmark

45 stars 14 forks source link

disable heap trimming while running gzip benchmark #2

Open shijith opened 5 years ago

shijith commented 5 years ago

gzip dynamic memory allocation size per compression is 136K. It is above malloc trim threshold of 128K. So heap will be trimmed on each loop as we call free. It causes break system call to be called per loop and impacts performance. Resulting benchmark data will be inaccurate. Trimming can be disabled by setting MALLOC_TRIMTHRESHOLD to -1.

New allocations will also cause an increase in page faults. Below are the results for gzip with quality 4 and single thread: Page faults with trimming: 392,546 Page faults without trimming: 388

Signed-off-by: Shijith Thotton sthotton@marvell.com

baonq-me commented 1 month ago

@shijith @robdinh Should we merge this PR ?