asv-tachyon 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. asv_tachyon-0.1.0/.gitignore +53 -0
  2. asv_tachyon-0.1.0/CHANGELOG.md +3 -0
  3. asv_tachyon-0.1.0/CODEOWNERS +13 -0
  4. asv_tachyon-0.1.0/CODE_OF_CONDUCT.md +132 -0
  5. asv_tachyon-0.1.0/LICENSE +19 -0
  6. asv_tachyon-0.1.0/PKG-INFO +169 -0
  7. asv_tachyon-0.1.0/README.md +122 -0
  8. asv_tachyon-0.1.0/branding/logo/asv_tachyon_logo.jpg +0 -0
  9. asv_tachyon-0.1.0/branding/logo/asv_tachyon_logo.png +0 -0
  10. asv_tachyon-0.1.0/changelog.d/1.feat.md +1 -0
  11. asv_tachyon-0.1.0/changelog.d/readme.md +3 -0
  12. asv_tachyon-0.1.0/docs/export.el +25 -0
  13. asv_tachyon-0.1.0/docs/orgmode/contributing/index.org +13 -0
  14. asv_tachyon-0.1.0/docs/orgmode/explanation/sampling_vs_tracing.org +11 -0
  15. asv_tachyon-0.1.0/docs/orgmode/howto/asv_plugin.org +26 -0
  16. asv_tachyon-0.1.0/docs/orgmode/howto/diff_flamegraph.org +14 -0
  17. asv_tachyon-0.1.0/docs/orgmode/index.org +60 -0
  18. asv_tachyon-0.1.0/docs/orgmode/reference/cli.org +7 -0
  19. asv_tachyon-0.1.0/docs/orgmode/reference/formats.org +14 -0
  20. asv_tachyon-0.1.0/docs/orgmode/tutorials/first_sample.org +16 -0
  21. asv_tachyon-0.1.0/docs/source/conf.py +19 -0
  22. asv_tachyon-0.1.0/pixi.toml +46 -0
  23. asv_tachyon-0.1.0/pyproject.toml +155 -0
  24. asv_tachyon-0.1.0/scripts/org_to_md.sh +57 -0
  25. asv_tachyon-0.1.0/src/asv_tachyon/__init__.py +16 -0
  26. asv_tachyon-0.1.0/src/asv_tachyon/__main__.py +4 -0
  27. asv_tachyon-0.1.0/src/asv_tachyon/_version.py +24 -0
  28. asv_tachyon-0.1.0/src/asv_tachyon/cli.py +362 -0
  29. asv_tachyon-0.1.0/src/asv_tachyon/driver.py +152 -0
  30. asv_tachyon-0.1.0/src/asv_tachyon/gui.py +103 -0
  31. asv_tachyon-0.1.0/src/asv_tachyon/plugin.py +20 -0
  32. asv_tachyon-0.1.0/src/asv_tachyon/sample.py +239 -0
  33. asv_tachyon-0.1.0/src/asv_tachyon/util.py +127 -0
  34. asv_tachyon-0.1.0/tbump.toml +29 -0
  35. asv_tachyon-0.1.0/tests/test_driver_unit.py +41 -0
  36. asv_tachyon-0.1.0/tests/test_gui.py +20 -0
  37. asv_tachyon-0.1.0/tests/test_sample_cmd.py +100 -0
  38. asv_tachyon-0.1.0/tests/test_util.py +32 -0
  39. asv_tachyon-0.1.0/towncrier.toml +9 -0
@@ -0,0 +1,53 @@
1
+ # Byte-compiled
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+
7
+ # Packaging
8
+ build/
9
+ dist/
10
+ *.egg-info/
11
+ .eggs/
12
+ src/asv_tachyon/_version.py
13
+
14
+ # Testing / tooling
15
+ .pytest_cache/
16
+ .ruff_cache/
17
+ .mypy_cache/
18
+ .coverage
19
+ htmlcov/
20
+ .tox/
21
+ .nox/
22
+
23
+ # Envs
24
+ .venv/
25
+ venv/
26
+ .env
27
+ .env.*
28
+
29
+ # ASV / tachyon artifacts
30
+ .asv/
31
+ *.tachyon.bin
32
+ flamegraph*.html
33
+ heatmap*/
34
+
35
+ # Docs
36
+ docs/build/
37
+ docs/source/*.rst
38
+ !docs/source/conf.py
39
+ docs/source/tutorials/
40
+ docs/source/howto/
41
+ docs/source/reference/
42
+ docs/source/explanation/
43
+ docs/source/contributing/
44
+
45
+ # Editors / OS
46
+ .idea/
47
+ .vscode/
48
+ *.swp
49
+ .DS_Store
50
+
51
+ # uv / pixi
52
+ uv.lock
53
+ .pixi/
@@ -0,0 +1,3 @@
1
+ # Changelog
2
+
3
+ <!-- towncrier release notes start -->
@@ -0,0 +1,13 @@
1
+ # This is a comment.
2
+ # Each line is a file pattern followed by one or more owners.
3
+
4
+ # These owners will be the default owners for everything in
5
+ # the repo. Unless a later match takes precedence,
6
+ # @global-owner1 and @global-owner2 will be requested for
7
+ # review when someone opens a pull request.
8
+ * @HaoZeke
9
+
10
+ # Order is important; the last matching pattern takes the most
11
+ # precedence. When someone opens a pull request that only
12
+ # modifies JS files, for example, only @js-owner and not the global
13
+ # owner(s) will be requested for a review.
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,19 @@
1
+ MIT License Copyright (c) 2024 Rohit Goswami (HaoZeke) <rgoswami[at]ieee.org>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is furnished
8
+ to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice (including the next
11
+ paragraph) shall be included in all copies or substantial portions of the
12
+ Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17
+ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19
+ OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,169 @@
1
+ Metadata-Version: 2.4
2
+ Name: asv-tachyon
3
+ Version: 0.1.0
4
+ Summary: Near-zero-overhead Tachyon sampling profiles for ASV benchmarks
5
+ Project-URL: Documentation, https://haozeke.github.io/asv_tachyon/
6
+ Project-URL: Issues, https://github.com/HaoZeke/asv_tachyon/issues
7
+ Project-URL: Source, https://github.com/HaoZeke/asv_tachyon
8
+ Project-URL: Changelog, https://github.com/HaoZeke/asv_tachyon/blob/main/CHANGELOG.md
9
+ Author-email: Rohit Goswami <rgoswami@ieee.org>
10
+ Maintainer-email: Rohit Goswami <rgoswami@ieee.org>
11
+ License: MIT
12
+ License-File: LICENSE
13
+ Keywords: asv,benchmark,flamegraph,profiling,python-3.15,sampling,tachyon
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: Science/Research
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3 :: Only
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.13
26
+ Classifier: Programming Language :: Python :: 3.14
27
+ Classifier: Programming Language :: Python :: 3.15
28
+ Classifier: Topic :: Software Development :: Testing
29
+ Classifier: Topic :: System :: Benchmark
30
+ Classifier: Topic :: System :: Monitoring
31
+ Requires-Python: >=3.10
32
+ Requires-Dist: asv-runner>=0.2.1
33
+ Requires-Dist: asv>=0.6.4
34
+ Requires-Dist: click>=8.1
35
+ Provides-Extra: docs
36
+ Requires-Dist: shibuya>=2024.1; extra == 'docs'
37
+ Requires-Dist: sphinx-sitemap>=2.5; extra == 'docs'
38
+ Requires-Dist: sphinx>=7.0; extra == 'docs'
39
+ Provides-Extra: rel
40
+ Requires-Dist: build>=1.0; extra == 'rel'
41
+ Requires-Dist: tbump>=6.11; extra == 'rel'
42
+ Requires-Dist: towncrier>=23.6; extra == 'rel'
43
+ Requires-Dist: twine>=5.0; extra == 'rel'
44
+ Provides-Extra: test
45
+ Requires-Dist: pytest>=8.0; extra == 'test'
46
+ Description-Content-Type: text/markdown
47
+
48
+ ![asv-tachyon](./branding/logo/asv_tachyon_logo.png)
49
+
50
+ # asv-tachyon
51
+
52
+ [![CI](https://github.com/HaoZeke/asv_tachyon/actions/workflows/ci.yml/badge.svg)](https://github.com/HaoZeke/asv_tachyon/actions/workflows/ci.yml)
53
+ [![PyPI](https://img.shields.io/pypi/v/asv-tachyon.svg)](https://pypi.org/project/asv-tachyon/)
54
+ [![Python](https://img.shields.io/pypi/pyversions/asv-tachyon.svg)](https://pypi.org/project/asv-tachyon/)
55
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
56
+
57
+ Near-zero-overhead [Tachyon](https://docs.python.org/3.15/library/profiling.sampling.html) sampling profiles for [Airspeed Velocity](https://asv.readthedocs.io/) benchmarks.
58
+
59
+ 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.
60
+
61
+ ## Why
62
+
63
+ 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:
64
+
65
+ - long benchmarks and production-like workloads keep realistic timings
66
+ - wall / CPU / GIL / exception **modes** separate waiting from working
67
+ - `--all-threads` and `--async-aware` cover real concurrency
68
+ - outputs include interactive flame graphs and line-level heatmaps
69
+
70
+ ## Install
71
+
72
+ ```bash
73
+ pip install asv-tachyon
74
+ # or
75
+ uv pip install asv-tachyon
76
+ ```
77
+
78
+ 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:
79
+
80
+ ```json
81
+ {
82
+ "matrix": {
83
+ "req": {
84
+ "pip+asv-tachyon": [""]
85
+ }
86
+ },
87
+ "plugins": ["asv_tachyon.plugin"]
88
+ }
89
+ ```
90
+
91
+ ## Quick start
92
+
93
+ From an ASV project root (with `asv.conf.json` and `benchmarks/`):
94
+
95
+ ```bash
96
+ # Flame graph for one benchmark (parameterized names use ASV's -N suffix)
97
+ asv-tachyon sample benchmarks.TimeSuite.time_keys-0 --browser
98
+
99
+ # CPU-only, all threads, binary capture for later replay
100
+ asv-tachyon sample benchmarks.TimeSuite.time_keys-0 \
101
+ --mode cpu --all-threads --format binary -o slow.tachyon.bin
102
+
103
+ # Replay binary -> heatmap
104
+ asv-tachyon replay slow.tachyon.bin --format heatmap -o heat --browser
105
+
106
+ # Differential flame graph after a fix
107
+ asv-tachyon sample benchmarks.TimeSuite.time_keys-0 \
108
+ --format diff-flamegraph --baseline slow.tachyon.bin -o diff.html --browser
109
+
110
+ # Sanity-check the target interpreter
111
+ asv-tachyon doctor --python "$(which python3.15)"
112
+ ```
113
+
114
+ Point at a specific 3.15 environment:
115
+
116
+ ```bash
117
+ asv-tachyon sample benchmarks.TimeSuite.time_keys-0 \
118
+ -E "existing:$(pwd)/.asv/env/venv-py3.15/bin/python"
119
+ # or
120
+ asv-tachyon sample benchmarks.TimeSuite.time_keys-0 \
121
+ --python /path/to/python3.15
122
+ ```
123
+
124
+ ## ASV plugin GUI
125
+
126
+ With `"plugins": ["asv_tachyon.plugin"]` in `asv.conf.json`:
127
+
128
+ ```bash
129
+ asv profile --gui=list # shows tachyon / flamegraph
130
+ asv profile --gui=tachyon PATH # opens HTML flamegraph/heatmap artifacts
131
+ ```
132
+
133
+ 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.
134
+
135
+ ## CLI reference (summary)
136
+
137
+ | Command | Purpose |
138
+ |---------|---------|
139
+ | `asv-tachyon sample BENCH` | Run BENCH under Tachyon |
140
+ | `asv-tachyon replay BIN` | Convert a binary capture |
141
+ | `asv-tachyon open PATH` | Open HTML / heatmap dir |
142
+ | `asv-tachyon doctor` | Check 3.15 + imports |
143
+ | `asv-tachyon formats` | List output formats |
144
+
145
+ Useful `sample` flags: `--format`, `--mode`, `-r/--rate`, `--duration`, `--loops`, `-a/--all-threads`, `--native`, `--async-aware`, `--live`, `--browser`, `--baseline` (for diff flame graphs).
146
+
147
+ ## Development
148
+
149
+ ```bash
150
+ git clone https://github.com/HaoZeke/asv_tachyon
151
+ cd asv_tachyon
152
+ uv venv -p 3.12 .venv && source .venv/bin/activate
153
+ uv pip install -e '.[test]'
154
+ pytest -q
155
+ ```
156
+
157
+ Rebuild the README from orgmode:
158
+
159
+ ```bash
160
+ ./scripts/org_to_md.sh readme_src.org README.md
161
+ ```
162
+
163
+ ## Name and logo
164
+
165
+ **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.
166
+
167
+ ## License
168
+
169
+ MIT. See `LICENSE`.
@@ -0,0 +1,122 @@
1
+ ![asv-tachyon](./branding/logo/asv_tachyon_logo.png)
2
+
3
+ # asv-tachyon
4
+
5
+ [![CI](https://github.com/HaoZeke/asv_tachyon/actions/workflows/ci.yml/badge.svg)](https://github.com/HaoZeke/asv_tachyon/actions/workflows/ci.yml)
6
+ [![PyPI](https://img.shields.io/pypi/v/asv-tachyon.svg)](https://pypi.org/project/asv-tachyon/)
7
+ [![Python](https://img.shields.io/pypi/pyversions/asv-tachyon.svg)](https://pypi.org/project/asv-tachyon/)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+
10
+ Near-zero-overhead [Tachyon](https://docs.python.org/3.15/library/profiling.sampling.html) sampling profiles for [Airspeed Velocity](https://asv.readthedocs.io/) benchmarks.
11
+
12
+ 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.
13
+
14
+ ## Why
15
+
16
+ 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:
17
+
18
+ - long benchmarks and production-like workloads keep realistic timings
19
+ - wall / CPU / GIL / exception **modes** separate waiting from working
20
+ - `--all-threads` and `--async-aware` cover real concurrency
21
+ - outputs include interactive flame graphs and line-level heatmaps
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pip install asv-tachyon
27
+ # or
28
+ uv pip install asv-tachyon
29
+ ```
30
+
31
+ 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:
32
+
33
+ ```json
34
+ {
35
+ "matrix": {
36
+ "req": {
37
+ "pip+asv-tachyon": [""]
38
+ }
39
+ },
40
+ "plugins": ["asv_tachyon.plugin"]
41
+ }
42
+ ```
43
+
44
+ ## Quick start
45
+
46
+ From an ASV project root (with `asv.conf.json` and `benchmarks/`):
47
+
48
+ ```bash
49
+ # Flame graph for one benchmark (parameterized names use ASV's -N suffix)
50
+ asv-tachyon sample benchmarks.TimeSuite.time_keys-0 --browser
51
+
52
+ # CPU-only, all threads, binary capture for later replay
53
+ asv-tachyon sample benchmarks.TimeSuite.time_keys-0 \
54
+ --mode cpu --all-threads --format binary -o slow.tachyon.bin
55
+
56
+ # Replay binary -> heatmap
57
+ asv-tachyon replay slow.tachyon.bin --format heatmap -o heat --browser
58
+
59
+ # Differential flame graph after a fix
60
+ asv-tachyon sample benchmarks.TimeSuite.time_keys-0 \
61
+ --format diff-flamegraph --baseline slow.tachyon.bin -o diff.html --browser
62
+
63
+ # Sanity-check the target interpreter
64
+ asv-tachyon doctor --python "$(which python3.15)"
65
+ ```
66
+
67
+ Point at a specific 3.15 environment:
68
+
69
+ ```bash
70
+ asv-tachyon sample benchmarks.TimeSuite.time_keys-0 \
71
+ -E "existing:$(pwd)/.asv/env/venv-py3.15/bin/python"
72
+ # or
73
+ asv-tachyon sample benchmarks.TimeSuite.time_keys-0 \
74
+ --python /path/to/python3.15
75
+ ```
76
+
77
+ ## ASV plugin GUI
78
+
79
+ With `"plugins": ["asv_tachyon.plugin"]` in `asv.conf.json`:
80
+
81
+ ```bash
82
+ asv profile --gui=list # shows tachyon / flamegraph
83
+ asv profile --gui=tachyon PATH # opens HTML flamegraph/heatmap artifacts
84
+ ```
85
+
86
+ 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.
87
+
88
+ ## CLI reference (summary)
89
+
90
+ | Command | Purpose |
91
+ |---------|---------|
92
+ | `asv-tachyon sample BENCH` | Run BENCH under Tachyon |
93
+ | `asv-tachyon replay BIN` | Convert a binary capture |
94
+ | `asv-tachyon open PATH` | Open HTML / heatmap dir |
95
+ | `asv-tachyon doctor` | Check 3.15 + imports |
96
+ | `asv-tachyon formats` | List output formats |
97
+
98
+ Useful `sample` flags: `--format`, `--mode`, `-r/--rate`, `--duration`, `--loops`, `-a/--all-threads`, `--native`, `--async-aware`, `--live`, `--browser`, `--baseline` (for diff flame graphs).
99
+
100
+ ## Development
101
+
102
+ ```bash
103
+ git clone https://github.com/HaoZeke/asv_tachyon
104
+ cd asv_tachyon
105
+ uv venv -p 3.12 .venv && source .venv/bin/activate
106
+ uv pip install -e '.[test]'
107
+ pytest -q
108
+ ```
109
+
110
+ Rebuild the README from orgmode:
111
+
112
+ ```bash
113
+ ./scripts/org_to_md.sh readme_src.org README.md
114
+ ```
115
+
116
+ ## Name and logo
117
+
118
+ **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.
119
+
120
+ ## License
121
+
122
+ MIT. See `LICENSE`.
@@ -0,0 +1 @@
1
+ Initial release: sample ASV benchmarks with Python 3.15 Tachyon (`profiling.sampling`), emit flame graphs / heatmaps / gecko / binary captures, and register an `asv profile --gui=tachyon` viewer.
@@ -0,0 +1,3 @@
1
+ # Changelog fragments
2
+
3
+ Add a fragment named like `123.feat.md` before releasing.
@@ -0,0 +1,25 @@
1
+ ;; Setup Package Manager (to fetch ox-rst automatically)
2
+ (require 'package)
3
+ (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
4
+ (package-initialize)
5
+
6
+ ;; Ensure ox-rst is present
7
+ (unless (package-installed-p 'ox-rst)
8
+ (package-refresh-contents)
9
+ (package-install 'ox-rst))
10
+
11
+ (require 'ox-rst)
12
+ (require 'ox-publish)
13
+
14
+ ;; Define the Publishing Project
15
+ (setq org-publish-project-alist
16
+ '(("sphinx-rst"
17
+ :base-directory "./orgmode/"
18
+ :base-extension "org"
19
+ :publishing-directory "./source/"
20
+ :publishing-function org-rst-publish-to-rst
21
+ :recursive t
22
+ :headline-levels 4)))
23
+
24
+ ;; Run the publish
25
+ (org-publish "sphinx-rst" t)
@@ -0,0 +1,13 @@
1
+ #+TITLE: Contributing
2
+ #+OPTIONS: toc:nil num:nil author:nil title:nil ^:nil
3
+
4
+ * Contributing
5
+
6
+ Issues and PRs welcome at https://github.com/HaoZeke/asv_tachyon.
7
+
8
+ #+begin_src bash
9
+ uv pip install -e '.[test]'
10
+ pytest -q
11
+ #+end_src
12
+
13
+ Use Conventional Commits. Changelog fragments go in =changelog.d/=.
@@ -0,0 +1,11 @@
1
+ #+TITLE: Sampling vs tracing
2
+ #+OPTIONS: toc:nil num:nil author:nil title:nil ^:nil
3
+
4
+ * Sampling vs tracing
5
+
6
+ Tracing profilers (=cProfile= / =profiling.tracing=) hook every call and return.
7
+ They give exact counts but add high overhead.
8
+
9
+ Sampling profilers (Tachyon) snapshot the stack on a timer from outside the
10
+ process. They miss rare short functions and do not report call counts, but they
11
+ leave the workload almost undisturbed---ideal for long ASV benchmarks.
@@ -0,0 +1,26 @@
1
+ #+TITLE: Register the ASV plugin
2
+ #+OPTIONS: toc:nil num:nil author:nil title:nil ^:nil
3
+
4
+ * Register the ASV plugin
5
+
6
+ Add to =asv.conf.json=:
7
+
8
+ #+begin_src json
9
+ {
10
+ "plugins": ["asv_tachyon.plugin"],
11
+ "matrix": {
12
+ "req": {
13
+ "pip+asv-tachyon": [""]
14
+ }
15
+ }
16
+ }
17
+ #+end_src
18
+
19
+ Then:
20
+
21
+ #+begin_src bash
22
+ asv profile --gui=list
23
+ #+end_src
24
+
25
+ Use =asv-tachyon sample= to collect sampling profiles. Use
26
+ =asv profile --gui=tachyon= only for opening Tachyon HTML artifacts.
@@ -0,0 +1,14 @@
1
+ #+TITLE: Differential flame graphs
2
+ #+OPTIONS: toc:nil num:nil author:nil title:nil ^:nil
3
+
4
+ * Differential flame graphs
5
+
6
+ #+begin_src bash
7
+ asv-tachyon sample bench.time_x --format binary -o before.bin
8
+ # ... apply a fix ...
9
+ asv-tachyon sample bench.time_x \
10
+ --format diff-flamegraph --baseline before.bin -o diff.html --browser
11
+ #+end_src
12
+
13
+ Widths show the *current* run. Colors show change versus the baseline (blue =
14
+ less self time share, red = more, purple = new frames).
@@ -0,0 +1,60 @@
1
+ #+TITLE: asv-tachyon
2
+ #+AUTHOR: [[https://rgoswami.me][Rohit Goswami]]
3
+ #+OPTIONS: toc:nil todo:nil num:nil author:nil title:nil ^:nil
4
+
5
+ #+begin_export rst
6
+ ===========================
7
+ asv-tachyon
8
+ ===========================
9
+
10
+ :Author: `Rohit Goswami <https://rgoswami.me>`_
11
+ #+end_export
12
+
13
+ Near-zero-overhead Tachyon sampling profiles for Airspeed Velocity benchmarks.
14
+
15
+ Python 3.15's =profiling.sampling= module (Tachyon) samples call stacks from
16
+ outside the target process. *asv-tachyon* runs ASV benchmarks under that
17
+ sampler and turns the results into flame graphs, heatmaps, and more.
18
+
19
+ * Install
20
+
21
+ #+begin_src bash
22
+ pip install asv-tachyon
23
+ #+end_src
24
+
25
+ Target environments need Python >= 3.15. The host CLI supports Python 3.10+.
26
+
27
+ #+begin_export rst
28
+
29
+ .. toctree::
30
+ :maxdepth: 2
31
+ :caption: Tutorials
32
+
33
+ tutorials/first_sample
34
+
35
+ .. toctree::
36
+ :maxdepth: 2
37
+ :caption: How-To Guides
38
+
39
+ howto/asv_plugin
40
+ howto/diff_flamegraph
41
+
42
+ .. toctree::
43
+ :maxdepth: 2
44
+ :caption: Reference
45
+
46
+ reference/cli
47
+ reference/formats
48
+
49
+ .. toctree::
50
+ :maxdepth: 2
51
+ :caption: Explanation
52
+
53
+ explanation/sampling_vs_tracing
54
+
55
+ .. toctree::
56
+ :maxdepth: 2
57
+ :caption: Development
58
+
59
+ contributing/index
60
+ #+end_export