diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 9a56b363d..3720a64d0 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -32,6 +32,16 @@ jobs: - name: Compile run: cargo build --release -p oxc_benchmark + - name: Sleep for CPU cooldown (windows) + if: runner.os == 'Windows' + shell: powershell + run: Start-Sleep -s 15 + + - name: Sleep for CPU cooldown + if: runner.os != 'Windows' + shell: bash + run: sleep 15s + - name: Run Bench on PR Branch run: cargo benchmark --save-baseline pr @@ -44,6 +54,16 @@ jobs: - name: Compile run: cargo build --release -p oxc_benchmark + - name: Sleep for CPU cooldown (windows) + if: runner.os == 'Windows' + shell: powershell + run: Start-Sleep -s 15 + + - name: Sleep for CPU cooldown + if: runner.os != 'Windows' + shell: bash + run: sleep 15s + - name: Run Bench on Main Branch run: cargo benchmark --save-baseline main diff --git a/tasks/benchmark/src/main.rs b/tasks/benchmark/src/main.rs index 1d4c9333c..6f342dc51 100644 --- a/tasks/benchmark/src/main.rs +++ b/tasks/benchmark/src/main.rs @@ -33,7 +33,7 @@ pub fn main() -> Result<(), String> { let mut args = Arguments::from_env(); let baseline: Option = args.opt_value_from_str("--save-baseline").unwrap(); - let measurement_time = Duration::new(/* seconds */ 10, 0); + let measurement_time = Duration::new(/* seconds */ 15, 0); let mut criterion = Criterion::default().without_plots().measurement_time(measurement_time); if let Some(ref baseline) = baseline { criterion = criterion.save_baseline(baseline.to_string());