Skip to main content

asv_bench_tachyon

ASV benchmark type plugin (same contract as asv_bench_memray).

Defines sample_* / Sample* benchmarks. asv run stores a number (estimated exclusive time per call from Python 3.15 Tachyon samples) in results for history, compare, and graphs.

There is no separate CLI package. Install this into the benchmark environment and write sample_* functions.

Related packages (metric plugin vs web UI)

Package Role
asv Run benchmarks, write results, asv publish
asv-runner Discovers builtin + external asv_bench* types
asv_bench_tachyon (this package) sample_* metric plugin — a number in ASV results
asv-tachyon Modern web UI over published ASV HTML (not this package)
asv-spyglass CLI compare + SBOM-style env-diff
asv-perch PR comment tables (CI)
asv_bench_memray ray_* peak-memory metric plugin (same discovery contract)

asv_bench_tachyon is not the asv-tachyon web UI. Installing this package does not serve or replace the results site. It only registers a new benchmark type so sample_hot_loop is measured via Tachyon sampling and written into the usual ASV result JSON. Pair with asv-tachyon only if you want the modern dashboard over asv publish output.

Install

pip install asv_bench_tachyon

Python >= 3.15 (needs stdlib profiling.sampling). The package must be importable inside each ASV benchmark environment, not only on the host that runs asv. Put it on the ASV matrix:

{
  "matrix": {
    "req": {
      "pip+asv_bench_tachyon": [""]
    }
  }
}

Editable / local checkout during development:

{
  "matrix": {
    "req": {
      "pip+asv_bench_tachyon": ["../asv_bench_tachyon"]
    }
  }
}

If an environment was created before the matrix change:

rm -rf .asv/env
asv run --bench sample_

Benchmark attributes

Name the function sample_* or Sample* so the type is selected. Optional attributes (also accepted on the class or module, first wins via asv_runner):

Attribute Default Meaning
sample_mode "wall" Tachyon sampling mode: "wall", "cpu", or "gil"
sample_duration 0.25 Seconds of sampling (clamped to ≥ 0.05)
sample_interval_usec 1000 Sample interval in microseconds (clamped to ≥ 100)

sample_mode

Mode Use when
"wall" Wall-clock inclusive sampling (default). Good general exclusive-time estimate under load.
"cpu" CPU-time sampling. Prefer for pure compute loops that should ignore I/O wait.
"gil" GIL-oriented sampling. Prefer when contention / hold time is the signal of interest.

Invalid values raise ValueError at run time.

sample_duration

How long the sampler and the call loop run. Longer duration → more stack samples → stabler exclusive-time estimate, at the cost of wall time per benchmark. Values below 0.05 are raised to 0.05.

Metric returned

Estimated seconds per call:

(self_samples * sample_interval_s) / n_calls

Self samples are counted for the benchmark function name when present; otherwise all collector direct-call counts are summed. Unit is seconds, type is time, so stock ASV history / compare / graphs work unchanged.

Example

class Suite:
    def sample_hot_loop(self):
        s = 0
        for i in range(200_000):
            s += i * i
        return s

    sample_hot_loop.sample_mode = "cpu"     # wall | cpu | gil
    sample_hot_loop.sample_duration = 0.25  # seconds of sampling
asv run --bench sample_hot_loop

A full mini-suite (two sample_* functions, matrix install, asv.conf.json) lives under examples/.

Discovery contract

asv_runner loads external types the same way as memray:

  1. Distribution / package name starts with asv_bench
  2. Package has a benchmarks/ subpackage
  3. Each submodule may export export_as_benchmark = [SomeBenchmark, ...]

This package:

  • Distribution name: asv_bench_tachyon
  • Module: asv_bench_tachyon.benchmarks.sampletime
  • Export: export_as_benchmark = [SampleTimeBenchmark]
  • Name regex: ^(Sample[A-Z_].+)|(sample_.+)$

No asv profile GUI, no standalone CLI, no HTML UI. Metrics only.

License

MIT.

Metadata

Release files for asv-bench-tachyon 0.1.2

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

Source distribution (sdist)

Source distribution for asv-bench-tachyon 0.1.2
File Size Uploaded
asv_bench_tachyon-0.1.2.tar.gz 233.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for asv-bench-tachyon 0.1.2
File Interpreter ABI Platform
asv_bench_tachyon-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 240.5 kB

Release files / asv_bench_tachyon-0.1.2.tar.gz

Download URL asv_bench_tachyon-0.1.2.tar.gz
Size 233.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fabc48821476bf651ccad3bb81bb5b84f49cd05ae444c6d03e7d516813bd4094
BLAKE2b-256 checksum
How to use checksums
55d8d0985cd6af9beb52968859c5553bf0090bd10c7a91ce97661d23ee9a6057
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / asv_bench_tachyon-0.1.2-py3-none-any.whl

Download URL asv_bench_tachyon-0.1.2-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46deb0f7331799aaabedd319b4b6ae6d369bdad0b7a89ec59718d79705b7aae9
BLAKE2b-256 checksum
How to use checksums
d25d901f3116857f411caddec7fa75389fe13a665cc61a2efb1bc92c314877f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

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