oracletrace icon indicating copy to clipboard operation
oracletrace copied to clipboard

[Feature] Add `--repeat` flag

Open KaykCaputo opened this issue 8 months ago • 6 comments

[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 N CLI 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

KaykCaputo avatar Mar 30 '26 15:03 KaykCaputo

@vincent5678 would you like to take a look at this? I think it’s a great fit for you.

KaykCaputo avatar Mar 31 '26 14:03 KaykCaputo

@KaykCaputo yes please

vincent5678 avatar Mar 31 '26 15:03 vincent5678

@KaykCaputo yes please

Nice, go for it

KaykCaputo avatar Mar 31 '26 18:03 KaykCaputo

@vincent5678 any news on this?

KaykCaputo avatar Apr 07 '26 13:04 KaykCaputo

@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 avatar Apr 11 '26 18:04 vincent5678

@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 👍

KaykCaputo avatar Apr 14 '26 19:04 KaykCaputo