Skip to main content

asv-tachyon

asv-tachyon

CI PyPI Python License: MIT

Near-zero-overhead Tachyon sampling profiles for Airspeed Velocity benchmarks.

Python 3.15 ships profiling.sampling (code-named Tachyon): an external statistical sampler that reads a process's call stack from outside, so the benchmark runs at full speed. asv-tachyon wires that sampler into ASV projects — flame graphs, heatmaps, gecko/Firefox Profiler exports, binary captures you can replay and diff, and an asv profile --gui=tachyon hook.

Why

ASV's built-in asv profile path still uses deterministic cProfile. That is exact, but expensive, and it distorts cheap functions. Tachyon samples from a sibling process, so:

  • long benchmarks and production-like workloads keep realistic timings
  • wall / CPU / GIL / exception modes separate waiting from working
  • --all-threads and --async-aware cover real concurrency
  • outputs include interactive flame graphs and line-level heatmaps

Install

pip install asv-tachyon
# or
uv pip install asv-tachyon

Sampling itself needs a target interpreter with Python >= 3.15 (the host CLI runs on 3.10+). Install the package into the same environment ASV uses for the benchmark, for example via the matrix:

{
  "matrix": {
    "req": {
      "pip+asv-tachyon": [""]
    }
  },
  "plugins": ["asv_tachyon.plugin"]
}

Quick start

From an ASV project root (with asv.conf.json and benchmarks/):

# Flame graph for one benchmark (parameterized names use ASV's -N suffix)
asv-tachyon sample benchmarks.TimeSuite.time_keys-0 --browser

# CPU-only, all threads, binary capture for later replay
asv-tachyon sample benchmarks.TimeSuite.time_keys-0 \
  --mode cpu --all-threads --format binary -o slow.tachyon.bin

# Replay binary -> heatmap
asv-tachyon replay slow.tachyon.bin --format heatmap -o heat --browser

# Differential flame graph after a fix
asv-tachyon sample benchmarks.TimeSuite.time_keys-0 \
  --format diff-flamegraph --baseline slow.tachyon.bin -o diff.html --browser

# Sanity-check the target interpreter
asv-tachyon doctor --python "$(which python3.15)"

Point at a specific 3.15 environment:

asv-tachyon sample benchmarks.TimeSuite.time_keys-0 \
  -E "existing:$(pwd)/.asv/env/venv-py3.15/bin/python"
# or
asv-tachyon sample benchmarks.TimeSuite.time_keys-0 \
  --python /path/to/python3.15

ASV plugin GUI

With "plugins": ["asv_tachyon.plugin"] in asv.conf.json:

asv profile --gui=list          # shows tachyon / flamegraph
asv profile --gui=tachyon PATH  # opens HTML flamegraph/heatmap artifacts

Note: asv profile still collects cProfile dumps. For sampling profiles, use asv-tachyon sample. The Tachyon GUI opens Tachyon HTML artifacts and points you at asv-tachyon sample when handed a cProfile file.

CLI reference (summary)

Command Purpose
asv-tachyon sample BENCH Run BENCH under Tachyon
asv-tachyon replay BIN Convert a binary capture
asv-tachyon open PATH Open HTML / heatmap dir
asv-tachyon doctor Check 3.15 + imports
asv-tachyon formats List output formats

Useful sample flags: --format, --mode, -r/--rate, --duration, --loops, -a/--all-threads, --native, --async-aware, --live, --browser, --baseline (for diff flame graphs).

Development

git clone https://github.com/HaoZeke/asv_tachyon
cd asv_tachyon
uv venv -p 3.12 .venv && source .venv/bin/activate
uv pip install -e '.[test]'
pytest -q

Rebuild the README from orgmode:

./scripts/org_to_md.sh readme_src.org README.md

Name and logo

Tachyon is CPython's code name for profiling.sampling — a nod to the hypothetical faster-than-light particle, matching the profiler's near-zero-overhead external sampling. The logo is a sampling strobe catching a speed-blurred swallow (ASV's mascot) mid-flight.

License

MIT. See LICENSE.

Download files

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

Source Distribution

asv_tachyon-0.1.1.tar.gz (452.7 kB view details)

Uploaded Source

Built Distribution

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

asv_tachyon-0.1.1-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file asv_tachyon-0.1.1.tar.gz.

File metadata

  • Download URL: asv_tachyon-0.1.1.tar.gz
  • Upload date:
  • Size: 452.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for asv_tachyon-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ed90a1b3f8ba2811d0d144f9a742362d3c6613ce4ad62fbfc975e7cfa38b4867
MD5 e7d860a4c9d60904a031b2872449d5d8
BLAKE2b-256 f7f54a4df6f29fa1965e3a8d5f3bd4e1c01ab3c58b6bc1c1398c0b3c0d2cb36f

See more details on using hashes here.

File details

Details for the file asv_tachyon-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: asv_tachyon-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for asv_tachyon-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d172c07456076ec47a78940088419759704d0878f37b6550f203f27b369777c
MD5 e09b3a69ca1d8d7e5114fdd22aee037f
BLAKE2b-256 b7d7cf635b439eb3790ba6e0550e19c3006f990f9c28da63d23fc92ccab2d0ca

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