On Tue, Feb 8, 2022 at 11:28 AM Christos P. Lamprakos <cplamprakos@microlab.ntua.gr> wrote:
As you point out, pyperf spawns lots of processes. I am interested only in those that actually run each benchmark. For instance, in the case of 2to3, I want to profile just the command that executes 2to3. If the inherit-environ option attaches the bytehound-related variables to the rest 19 processes besides the one running 2to3, tons of unwanted data will be collected. My experiments regard a resource-constrained device, so I would like to avoid that. Is this possible?
In pyperformance, you can use -b option to only run a single benchmark:
pyperformance run -b 2to3
pyperformance benchmarks can be found in pyperformance/benchmarks/. Each script is a standalone benchmark written with pyperf which can produce a JSON output using -o option: try --help.
Last but not least, if installing bytehound proves too hard, I will need to fall back on heaptrack or something similar. In this case profiler invocation is done with prepending 'heaptrack' to the command of interest instead of using some environment variable. Hence the question on command prepending in my previous email.
pyperf includes 2 options to track the memory usage:
--track-memory --tracemalloc
It tracks the memory in each worker process and then measure the mean memory usage with the std dev. Regular tools like "pyperf stats" work on it.
See pyperf doc for limitations: https://pyperf.readthedocs.io/en/latest/runner.html
Victor
Night gathers, and now my watch begins. It shall not end until my death.