Skip to content

Let scripts/gather-test-memory-data use less memory

Peter Leitzen requested to merge pl-script-gather-test-memory-perf into master

What does this MR do and why?

This MRs improves slighly the memory efficiency (lowering max resident set size - see below) of scripts/gather-test-memory-data by streaming content instead of slurping into memory when merging CSVs to ensure constant memory usage.

Screenshots or screen recordings

The resulting report.csv remains identical:

md5sum report.csv tmp/memory_test/report.csv
a3c99010e44c35af051ed856cc33bed6  report.csv
a3c99010e44c35af051ed856cc33bed6  tmp/memory_test/report.csv

Note the maxresident below (35204 15044).

Before

/usr/bin/time ruby <path-to-gdk>/scripts/gather-test-memory-data
0.42user 0.05system 0:00.41elapsed 114%CPU (0avgtext+0avgdata 35204maxresident)k
0inputs+3240outputs (1major+35794minor)pagefaults 0swaps

After

/usr/bin/time ruby <path-to-gdk>/scripts/gather-test-memory-data
0.38user 0.05system 0:00.38elapsed 115%CPU (0avgtext+0avgdata 15044maxresident)k
0inputs+3240outputs (0major+30725minor)pagefaults 0swaps

How to set up and validate locally

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports