Skip to main content

⚡ Performax

A lightweight profiling framework for JAX that makes it easy to measure execution time of your functions.

✨ Features

  • 🎯 Simple decorator API - Just add @track to functions you want to profile
  • 🚀 Minimal overhead - Uses JAX's built-in Perfetto tracing
  • 📊 Detailed statistics - Get total time, call counts, and averages
  • 📁 Multiple output formats - Pretty tables, dictionaries, pandas DataFrames, and more
  • 🎨 Flexible loggers - Rich tables, JSON, CSV, Markdown, and plain text output
  • 🔒 Thread-safe - Prevents concurrent profiling conflicts

📦 Installation

pip install performax

Or install from source:

git clone https://github.com/noahfarr/performax.git
cd performax
pip install -e .

🚀 Quick Start

import jax.numpy as jnp
from performax import track, profile

@track
def matmul(a, b):
    return jnp.dot(a, b)

@track(name="forward")
def forward(x, weights):
    for w in weights:
        x = matmul(x, w)
    return x

def main():
    x = jnp.ones((1000, 512))
    weights = [jnp.ones((512, 512)) for _ in range(5)]
    return forward(x, weights)

result, stats = profile(main)
print(stats)

Output:

Function | Total (ms) | Calls | Avg (ms)
-----------------------------------------
forward  | 125.432    | 1     | 125.432
matmul   | 98.765     | 5     | 19.753

📋 Requirements

  • Python >= 3.12
  • JAX >= 0.4.0
  • rich (optional, for RichLogger)
  • pandas (optional, for to_dataframe())

🛠️ Development

pip install -e ".[development]"

pytest
pytest --cov=performax
pytest -m "not slow"

📄 License

MIT

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Metadata

Release files for performax 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for performax 0.1.0
File Size Uploaded
performax-0.1.0.tar.gz 11.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for performax 0.1.0
File Interpreter ABI Platform
performax-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.6 kB

Release files / performax-0.1.0.tar.gz

Download URL performax-0.1.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
247f664ff2ca8635c705cfeaffb8c2ff5e49d4bdbebcc05047a2e416f894395a
BLAKE2b-256 checksum
How to use checksums
25951f057dd350d3b3ea55ddcc14278a110f6a0c922b7e484fcd2fc70191220e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / performax-0.1.0-py3-none-any.whl

Download URL performax-0.1.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5efd30a18afff4a63ba9060d652f2be6d56870a7f7257c146f629c45533a86b1
BLAKE2b-256 checksum
How to use checksums
99067ff8d3b0359dc8e0781a1dca8d7db63f85397735b86b4e1a21753650dfe9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page