Skip to main content

Tool for tracking python performance regressions

Project description

perfharness

Perfharness is a python library for tracking testcase performance over time.

How to use it

Install perfharness with pip install perfharness.

Write a perfharness testcase by building a python module with a main function that takes no arguments. You can do any setup you need in the root module namespace so that the code which actually gets timed can be in main.

Configure perfharness by putting a .perfharness.ini file in the current directory. Here is a sample configuration:

[perfharness]
sources_root = ../../..
sources = angr/angr,angr/angr_native,pyvex/pyvex,pyvex/pyvex_c,archinfo/archinfo,claripy/claripy,cle/cle,ailment/ailment
sources_ignore = *.o,*.so,*.a,*.pyc
build = pip install -e ./angr -e ./pyvex
cpu_percent_less_than = 10
mem_available_greater_than = 3gb
# https://docs.sqlalchemy.org/en/14/core/engines.html#database-urls
database = sqlite:///perf.db

Run perfharness with python -m perfharness run [options] testcase.py. Valid options include --num [n] to collect n runs of data and --warmup [n] to run the testcase n times before collecting any data.

Visualize your testcase performance over time with python -m perfharness viz [options] testcase.py. Different colors will be used to demarcate different attributes which might affect performance, such as the cpu and the python version.

scatter plot of a testcase being run under cpython and pypy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

perfharness-1.0.3.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

perfharness-1.0.3-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file perfharness-1.0.3.tar.gz.

File metadata

  • Download URL: perfharness-1.0.3.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for perfharness-1.0.3.tar.gz
Algorithm Hash digest
SHA256 969284fcc619b1def9dc606820310bda58572bbb3334f3a1d59e99dbdf248838
MD5 00bff7f17410c5d7b976c96e08e5af99
BLAKE2b-256 7d3ffd0e871159dbe6efbff3c4cd66ad7082d033c71570c1f6ec7ac78f6ca67b

See more details on using hashes here.

File details

Details for the file perfharness-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: perfharness-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for perfharness-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fc6595d56e9ced2caf2ce81a531d0868e73b1034d6103fb7c97584430a84a813
MD5 84885aaa083335773457ea5328b5ebbf
BLAKE2b-256 219f43f6088e1e1a82bb04f286afaa63cd7e630e864b5c3105ec8bc9faff7201

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page