The Python perf module comes with a pyperf program which includes different
commands. If for some reasons, pyperf program cannot be used, python3-mperf... can be used: it is the same, it’s just longer to type :-) For
example, the -mperf... syntax is preferred for timeit because this
command uses the running Python program.

Measure the wall clock time to run a command, similar to Unix time command.

If the resource.getrusage() function is available, measure also the maximum
RSS memory and stores it in command_max_rss metadata. In that case,
--track-memory option can be used to use the RSS memory for benchmark
values.

--include-benchmark=NAME only keeps the benchmark called NAME.
The option can be specified multiple times.

--exclude-benchmark=NAME removes the benchmark called NAME.
The option can be specified multiple times.

--include-runs=RUNS only keeps benchmark runs RUNS. RUNS is a
list of runs separated by commas, it can include a range using format
first-last which includes first and last values. Example:
1-3,7 (1, 2, 3, 7).

--remove-warmups: remove warmup values

--add=FILE: Add benchmark runs of benchmark FILE

--extract-metadata=NAME: Use metadata NAME as the new run values

--remove-all-metadata: Remove all benchmarks metadata except name and
unit.

--update-metadata=METADATA: Update metadata: METADATA is a
comma-separated list of KEY=VALUE

Options:

--indent: Indent JSON (rather using compact JSON)

--stdout writes the result encoded as JSON into stdout

Changed in version 1.2: The --include-benchmark and --exclude-benchmark operations can now
be specified multiple times.