Pyperf

Latest version: v2.7.0

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

Scan your dependencies

Page 4 of 9

1.5

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

* Fix ``--track-memory`` and ``--tracemalloc`` options.
Add non regression tests.
* Remove the ``--max-time`` option of Runner, it was ignored.
* Project moved from https://github.com/haypo/perf to https://github.com/vstinner/perf
* system command: In case the system is not ready for benchmarking, makes
system show exits with return code 2 so bash scripts could put
'python -m perf system show' directly without greping for the output.
Contributed by Boris Feld.
* On Windows: Enables high priority for processes when benchmarking
(``REALTIME_PRIORITY_CLASS``). Contributed by Steve Dower.

1.4

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

* Fix parse_cpu_list(): strip also NUL characters
* Add examples to the README file. Contributed by **Alex Willmer**.

1.3

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

* Add ``get_loops()`` and ``get_inner_loops()`` methods to Run and Benchmark
classes
* Documentation: add export_csv.py and plot.py examples
* Rewrite warmup calibration for PyPy:

- Use Q1, Q3 and stdev, rather than mean and checking if the first value
is an outlier
- Always use a sample of 10 values, rather than using a sample of a variable
size starting with 3 values

* Use lazy import for most imports of the largest modules to reduce the
number of imported module on 'import perf'.
* Fix handling of broken pipe error to prevent logging the error:
"Exception ignored in: ... BrokenPipeError: ..."
* ``collect_metadata`` gets more metadata on FreeBSD:

- use ``os.getloadavg()`` if ``/proc/loadavg`` is not available (ex: FreeBSD)
- use ``psutil.boot_time()`` if ``/proc/stat`` is not available (ex: FreeBSD)
to get ``boot_time`` and ``uptime`` metadata

* The Runner constructor now raises an exception if more than one instance is
created.

1.2

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

* ``stats`` command: count the number of outliers
* Rewrite the calibration code to support PyPy:

- On PyPy, calibrate also the number of warmups
- On PyPy, recalibrate the number of loops and warmups
- Loop calibration now uses the number of warmups and values instead
of 1 to compute warmup values
- A worker process cannot calibrate the number of loops and compute values.
These two operations now require two worker processes.

* Command line interface (CLI): the ``--benchmark``, ``--include-benchmark``
and ``--exclude-benchmark`` options can now be specified multiple times.
* Rewrite ``dump`` command:

- Writes one value per line
- Now display also metadata of calibration runs
- Enhance formatting of calibration runs
- Display number of warmup, value and loop

* Add new run metadata:

- ``calibrate_loops``, ``recalibrate_loops``: number of loops
of loop calibration/recalibration runs
- ``calibrate_warmups``, ``recalibrate_warmups``: number of warmups
of warmup calibration/recalibration runs

1.1

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

* Add a new "perf command" command to measure the timing of a program
* ``Runner.bench_command()`` now measures also the maximum RSS memory if
available.
* Fix Windows 32bit issue on Python 2.7, fix by yattom.
* ``Runner.bench_func()`` now uses ``functools.partial()`` if the function
has argument. Calling ``partial()`` is now 1.07x faster (-6%) than calling
``func(*args)``.
* Store memory values as integers, not float, when tracking memory usage
(``--track-memory`` and ``--tracemalloc`` options)

1.0

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

Enhancements:

* ``stats`` command now displays percentiles
* ``hist`` command now also checks the benchmark stability by default
* dump command now displays raw value of calibration runs.
* Add ``Benchmark.percentile()`` method

Backward incompatible changes:

* Remove the ``compare`` command to only keep the ``compare_to`` command
which is better defined
* Run warmup values must now be normalized per loop iteration.
* Remove ``format()`` and ``__str__()`` methods from Benchmark. These methods
were too opinionated.
* Rename ``--name=NAME`` option to ``--benchmark=NAME``
* Remove ``perf.monotonic_clock()`` since it wasn't monotonic on Python 2.7.
* Remove ``is_significant()`` from the public API

Other changes:

* check command now only complains if min/max is 50% smaller/larger than
the mean, instead of 25%.

Page 4 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.