psf / pyperf

Toolkit to run Python benchmarks
http://pyperf.readthedocs.io/
MIT License
797 stars 78 forks source link

Fix mem_max_rss measurement on macOS #173

Closed mdboom closed 7 months ago

mdboom commented 7 months ago

On BSD/darwin, ru_maxrss is defined in "bytes", unlike Linux where it is "kilobytes". Therefore, this code was wrongly multiplying the result by 1024. Rather than just fixing it here, it seems better to reuse the already correct get_max_rss function (used for calculating command_max_rss) elsewhere.