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:
- Distribution / package name starts with
asv_bench - Package has a
benchmarks/subpackage - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fabc48821476bf651ccad3bb81bb5b84f49cd05ae444c6d03e7d516813bd4094
|
|
| MD5 |
11bf53ad550f8afa4175fce2de056938
|
|
| BLAKE2b-256 |
55d8d0985cd6af9beb52968859c5553bf0090bd10c7a91ce97661d23ee9a6057
|
File details
Details for the file asv_bench_tachyon-0.1.2-py3-none-any.whl.
File metadata
- Download URL: asv_bench_tachyon-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46deb0f7331799aaabedd319b4b6ae6d369bdad0b7a89ec59718d79705b7aae9
|
|
| MD5 |
d209ae34e57f1377a354e93d50f39711
|
|
| BLAKE2b-256 |
d25d901f3116857f411caddec7fa75389fe13a665cc61a2efb1bc92c314877f2
|