Precision and Overhead Benchmarks
Sample measurements
One run on WSL2 with an RTX 3060 Laptop GPU (xprobe 0.7), measured as the ratio of target throughput without vs. with profiling over 2 s per case (lower is better; 1.00 = zero overhead):
| Collector | Workload | Throughput ratio | Event / sample rate |
|---|---|---|---|
| CUPTI callbacks + activity | Paced kernels | 1.0005 | ~6,800 events/s |
| CUPTI callbacks + activity | Empty-launch stress | 1.285 | ~2.7 µs per launch |
| Uprobe entry + return | Native function | 1.042 | ~1,300 pairs/s |
CPU sampling (--cpu-sample) | Native | 1.011 | 199 Hz |
CPU sampling (--cpu-sample) | CPython 3.12 (-X perf) | 1.027 | 199 Hz |
| CPython GC USDT | CPython 3.12 | 1.020 | GC lifecycles |
| External Python sampling (32-frame stack) | CPython 3.10 | 0.991 | 2,000 Hz GIL, p50 read 68 µs |
| External Python sampling (32-frame stack) | CPython 3.12 | 0.984 | 2,000 Hz GIL, p50 read 39 µs |
perf record | Native | 1.009 | 199 Hz |
py-spy record (default, pauses target) | CPython 3.12 | 1.184 | 199 Hz |
Per-event cost varies with kernel version, virtualization, and workload shape; re-run on your target host before drawing conclusions.
Running the benchmarks
Every benchmark uses fresh targets per case (profilers never coexist in the same process) and emits one JSON report.
CPU and Python (just benchmark-cpu / just benchmark-cpu-host)
just benchmark-cpu
Runs inside a pinned capability-limited container (just benchmark-cpu-host runs directly on a Linux host with perf, py-spy, CPython 3.12+ -X perf, and perf/eBPF permissions). Compares baseline, xprobe CPU sampling, syscall aggregate, exact uprobe/GC USDT (using inventory selector hints), perf, and py-spy.
External CPython sampler (just benchmark-python-sampling)
just benchmark-python-sampling
Runs a 32-frame hot Python leaf in python:3.10 and python:3.12 containers (3 runs each, baseline vs. --python-sample defaults) and checks the median throughput ratio against the 1.02 target along with achieved GIL Hz, discarded reads, and read latency. CPython < 3.11 reads one frame per syscall; 3.11+ reads the contiguous frame stack at once.
GPU callback overhead and timing precision (just benchmark-gpu)
just benchmark-gpu
Compares CUPTI kernel duration against an independent CUDA Event timer (fails above max(250 µs, 10%)), and measures host wall time with vs. without the CUPTI Agent on 5×1,000 empty launches and 5×200 ~1 ms paced kernels (< 2% overhead target when < 10,000 events/s).
Aggregate vs. raw GPU capture (just benchmark-aggregate)
just benchmark-aggregate
Captures a high-rate two-kernel CUDA workload once as raw exact events and once into a 4-slot aggregate table. Verifies zero drops, exact 2-group retention without table saturation, and lower collector CPU, peak RSS, target RSS growth, and artifact size for aggregate mode.
Multi-process CUDA workers (just benchmark-multiprocess)
just benchmark-multiprocess
Spawns 1, 2, and 4 CUDA workers, discovers them via discover, gathers selector hints from one worker, validates all workers, and runs concurrent per-worker specs.
PyTorch end-to-end (just benchmark-pytorch)
just benchmark-pytorch
Measures warmed-up torch.mm + stream synchronization across four separate runs: baseline, idle mapped Agent, active xprobe capture, and torch.profiler (separate process so CUPTI subscribers never collide). Reports throughput ratios against the 1.05 target, sample quality, drops, and buffer utilization.