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.0.tar.gz (452.2 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.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: asv_tachyon-0.1.0.tar.gz
  • Upload date:
  • Size: 452.2 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.0.tar.gz
Algorithm Hash digest
SHA256 bf233b7508907278f16eb354e12c310fbac0f968bbfb0d2fb12888595c6f56e9
MD5 0b9dd923a99eb550a33b03ace0550f80
BLAKE2b-256 0f189099f4c8e19473093554d17f56d5ac2c10e6311825760f870396474967a2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: asv_tachyon-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e16346a652d5595be55de7d8c81025369a320c85f730f6e6906fc27ec8366de
MD5 0a62bbb64e1bcd58accdf8640ec981bb
BLAKE2b-256 9b9f293457c06b834c40b7af71f6376320eb33d1e9aaf027036da77ba8882587

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