Pyperf

Latest version: v2.9.0

Safety actively analyzes 714875 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 7 of 10

0.8.1

--------------------------

* Rename ``metadata`` command to ``collect_metadata``
* Add new commands: ``metadata`` (display metadata of benchmarks files)
and ``check`` (check if benchmarks seem stable)
* timeit: add ``--duplicate`` option to reduce the overhead of the outer loop.
* BenchmarkSuite constructor now requires a non-empty sequence of Benchmark
objects.
* Store date in metadata with microsecond resolution.
* ``collect_metadata``: add ``--output`` command line option.
* Bugfix: don't follow symbolic links when getting the absolute path to a
Python executable. The venv module requires to use the symlink to get the
modules installed in a virtual environment.

0.8.0

--------------------------

The API was redesigned to support running multiple benchmarks with a single
Runner object.

Enhancements:

* ``--loops`` command line argument now accepts ``x^y`` syntax. For example,
``--loops=2^8`` uses ``256`` iterations
* Calibratation is now done in a dedicated process to avoid side effect on the
first process. This change is important if Python has a JIT compiler, to
get more reliable timings on the first worker computing samples.

Incompatible API changes:

* Benchmark constructor now requires a non-empty sequence of Run objects.
* A benchmark must now have a name: all runs must have a name metadata.
* Remove *name* argument from Runner constructor and add *name* parameter
to :func:`Benchmark.bench_func` and :func:`Benchmark.bench_sample_func`
* ``perf.text_runner.TextRunner`` becomes simply ``perf.Runner``.
Remove the ``perf.text_runner`` module.
* ``TextRunner.program_args`` attribute becomes a parameter of :class:`Runner`
constructor. *program_args* must no more start with ``sys.executable`` which
is automatically added, since the executable can now be overridden by the
``--python`` command line option.
* The ``TextRunner.prepare_subprocess_args`` attribute becomes a new
*add_cmdline_args* parameter of :class:`Runner` constructor which is called
with different arguments than the old *prepare_subprocess_args* callback.

Changes:

* Add *show_name* optional parameter to :class:`Runner`. The runner now
displays the benchmark name by default.
* The calibration is now done after starting tracing memory
* Run constructor now accepts an empty list of samples. Moreover, it also
accepts ``int`` and ``long`` number types for warmup sample values, not only
``float``.
* Add a new private ``--worker-task`` command line option to only execute
a specific benchmark function by its identifier.
* Runner now supports calling more than one benchmark function using
``--worker-task`` internally.
* Benchmark.dump() and BenchmarkSuite.dump() now fails by default if the
file already exists. Set the new *replace* parameter to true to allow to
replace an existing file.

0.7.12

---------------------------

* Add ``--python`` command line option
* ``timeit``: add ``--name``, ``--inner-loops`` and ``--compare-to`` options
* TextRunner don't set CPU affinity of the main process, only on worker
processes. It may help a little bit when using NOHZ_FULL.
* metadata: add ``boot_time`` and ``uptime`` on Linux
* metadata: add idle driver to ``cpu_config``

0.7.11

---------------------------

* Fix metadata when NOHZ is not used: when /sys/devices/system/cpu/nohz_full
contains `` (null)\n``

0.7.10

---------------------------

* Fix metadata when there is no isolated CPU
* Fix collecting metadata when /sys/devices/system/cpu/nohz_full doesn't exist

0.7.9

--------------------------

* Add :meth:`Benchmark.get_unit` method
* Add :meth:`BenchmarkSuite.get_metadata` method
* metadata: add ``nohz_full`` and ``isolated`` to ``cpu_config``
* add ``--affinity`` option to the ``metadata`` command
* ``convert``: fix ``--remove-all-metadata``, keep the unit
* metadata: fix regex to get the Mercurial revision for ``python_version``,
support also locally modified source code (revision ending with "+")

Page 7 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.