Skip to content

Instantly share code, notes, and snippets.

@bw2
bw2 / bench_us.py
Last active May 14, 2026 15:32
trviz Cython optimization PR — validation harness (1000-case differential test) and microsecond benchmark
"""Microsecond-precision benchmark for trviz.cy.decompose.decompose_cy.
Times decompose_cy on 6 representative cases (perfect repeats of varying
motif length, multi-motif mixes, mutated long sequences). Reports
min / median / mean over N iterations per case (default N=20).
Usage:
python3 bench_us.py [n_iter]
To compare two versions, run the script against each (e.g. on different