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.

Download files

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

Source Distribution

asv_bench_tachyon-0.1.2.tar.gz (233.8 kB view details)

Uploaded Source

Built Distribution

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

asv_bench_tachyon-0.1.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file asv_bench_tachyon-0.1.2.tar.gz.

File metadata

  • Download URL: asv_bench_tachyon-0.1.2.tar.gz
  • Upload date:
  • Size: 233.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for asv_bench_tachyon-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fabc48821476bf651ccad3bb81bb5b84f49cd05ae444c6d03e7d516813bd4094
MD5 11bf53ad550f8afa4175fce2de056938
BLAKE2b-256 55d8d0985cd6af9beb52968859c5553bf0090bd10c7a91ce97661d23ee9a6057

See more details on using hashes here.

File details

Details for the file asv_bench_tachyon-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for asv_bench_tachyon-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 46deb0f7331799aaabedd319b4b6ae6d369bdad0b7a89ec59718d79705b7aae9
MD5 d209ae34e57f1377a354e93d50f39711
BLAKE2b-256 d25d901f3116857f411caddec7fa75389fe13a665cc61a2efb1bc92c314877f2

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 Sentry Error logging StatusPage Status page