ci: sleep 15s before running the benchmark (#382)

This commit is contained in:
Boshen 2023-05-24 21:12:33 +08:00 committed by GitHub
parent 6811d67eb3
commit 1d617e64ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View file

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

View file

@ -33,7 +33,7 @@ pub fn main() -> Result<(), String> {
let mut args = Arguments::from_env();
let baseline: Option<String> = 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());