Skip to main content

Estimate Asymptotic Runtime Complexity from Bytecode executions

Project description

Python Performance Analysis Library or py-pal is a bytecode profiling toolkit.

Installation

This project requires CPython to run. Install Python >= 3.7, then install py-pal by running:

pip install py-pal

Documentation

TBA

Overview

Calling py-pal as module with

python -m py_pal file.py

or

pypal file.py

Measure specific functions using the decorator:

from py_pal.core import profile

@profile
def test():
    pass

Using the context manager:

from py_pal.tracer import Tracer

with Tracer() as t:
    pass

Using the API:

from py_pal.estimator import ComplexityEstimator
from py_pal.tracer import Tracer


t = Tracer()
t.trace()

# Your function
pass

t.stop()
estimator = ComplexityEstimator(t)
res = estimator.export()

# Do something with the resulting DataFrame
print(res)

Modes

Profiling and Performance Testing

Tracing processes

Development

To run the all tests run:

pip install -r dev-requirements.txt pytest tests

FAQ

Why not use a standard profiler?

Using absolute timing data vs synthetic timing data using opcodes.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

py_pal-0.1.5-cp38-cp38-win_amd64.whl (121.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

py_pal-0.1.5-cp38-cp38-win32.whl (115.4 kB view hashes)

Uploaded CPython 3.8 Windows x86

py_pal-0.1.5-cp37-cp37m-win_amd64.whl (120.8 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

py_pal-0.1.5-cp37-cp37m-win32.whl (114.6 kB view hashes)

Uploaded CPython 3.7m Windows x86

Supported by

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