[Feature] Add `--repeat` flag
[Feature] Add --repeat flag
Why
Single-run traces are sensitive to runtime noise (CPU scheduling, cache effects, I/O variability), which leads to unreliable regression detection. Running multiple executions and aggregating results provides more stable and trustworthy measurements.
How to
-
Add a
--repeat NCLI flag to execute the target script N times -
For each run, collect trace data normally
-
Aggregate results per function (e.g., median execution time)
-
Support two modes:
- Baseline generation: save aggregated (median) results to a JSON file
- Comparison: compare aggregated results against a baseline JSON
Example:
oracletrace app.py --repeat 10 --json baseline.json
oracletrace app.py --repeat 10 --compare baseline.json
Expected Results
- The same script is executed N times per run
- Output JSON represents aggregated (median) metrics, not a single execution
- Comparisons are performed using median values, reducing noise
- More consistent and reliable regression detection
@vincent5678 would you like to take a look at this? I think it’s a great fit for you.
@KaykCaputo yes please
@vincent5678 any news on this?
@KaykCaputo Yeah I've finished the functionality for repeating traces and aggregating results and I just have to finish processing that data. My only blocker is finding the time to work on it but trust me it's been open in my ide, staring at me for the last 2 weeks 😆
@vincent5678 Yeah, I know exactly how that feels. I work full-time during the day and college at night, so I get how chaotic it can get.
No rush — really appreciate the progress, it’s a solid feature 👍