From ef5ae4547a4eb0a2fc2309a9dac934275b86ae82 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Thu, 1 Oct 2020 20:32:05 +1000 Subject: chore: ensure cache is 'valid' during benchmarks (#7770) --- cli/bench/main.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'cli/bench') diff --git a/cli/bench/main.rs b/cli/bench/main.rs index cf640d1f7..aca6163d9 100644 --- a/cli/bench/main.rs +++ b/cli/bench/main.rs @@ -24,13 +24,9 @@ fn write_json(filename: &str, value: &Value) -> Result<()> { /// The list of the tuples of the benchmark name, arguments and return code const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option)] = &[ - ("hello", &["run", "cli/tests/002_hello.ts"], None), - ( - "relative_import", - &["run", "cli/tests/003_relative_import.ts"], - None, - ), - ("error_001", &["run", "cli/tests/error_001.ts"], Some(1)), + // we need to run the cold_* benchmarks before the _warm_ ones as they ensure + // the cache is properly populated, instead of other tests possibly + // invalidating that cache. ( "cold_hello", &["run", "--reload", "cli/tests/002_hello.ts"], @@ -41,6 +37,13 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option)] = &[ &["run", "--reload", "cli/tests/003_relative_import.ts"], None, ), + ("hello", &["run", "cli/tests/002_hello.ts"], None), + ( + "relative_import", + &["run", "cli/tests/003_relative_import.ts"], + None, + ), + ("error_001", &["run", "cli/tests/error_001.ts"], Some(1)), ( "no_check_hello", &["run", "--reload", "--no-check", "cli/tests/002_hello.ts"], -- cgit v1.2.3