From 3a56dffb9d62eceae5f8f4471fe384d21f671e8c Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 10 Aug 2019 14:06:08 +0200 Subject: [PATCH] Improve ci times --- .travis.yml | 9 +++++++-- test.sh | 11 +++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 17bcefde38b..e73e9933976 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,12 @@ rust: - nightly script: - - ./prepare.sh && ./test.sh + - ./prepare.sh + - ./test.sh --release env: - - RUST_BACKTRACE=1 + global: + # Enable backtraces for easier debugging. + - RUST_BACKTRACE=1 + # Reduce amount of benchmark runs as they are slow. + - COMPILE_RUNS=2 RUN_RUNS=2 diff --git a/test.sh b/test.sh index 8d1f4153719..aa5b1836527 100755 --- a/test.sh +++ b/test.sh @@ -58,10 +58,13 @@ echo "[TEST] rust-lang/regex example shootout-regex-dna" cat examples/regexdna-input.txt | ../cargo.sh run --example shootout-regex-dna > res.txt diff -u res.txt examples/regexdna-output.txt -echo "[TEST] rust-lang/regex standalone tests" +echo "[TEST] rust-lang/regex tests" ../cargo.sh test --tests -- --exclude-should-panic --test-threads 1 -Zunstable-options popd +echo +echo "[BENCH COMPILE] mod_bench" + COMPILE_MOD_BENCH_INLINE="$RUSTC example/mod_bench.rs --crate-type bin -Zmir-opt-level=3 -O --crate-name mod_bench_inline" COMPILE_MOD_BENCH_LLVM_0="rustc example/mod_bench.rs --crate-type bin -Copt-level=0 -o target/out/mod_bench_llvm_0 -Cpanic=abort" COMPILE_MOD_BENCH_LLVM_1="rustc example/mod_bench.rs --crate-type bin -Copt-level=1 -o target/out/mod_bench_llvm_1 -Cpanic=abort" @@ -69,10 +72,10 @@ COMPILE_MOD_BENCH_LLVM_2="rustc example/mod_bench.rs --crate-type bin -Copt-leve COMPILE_MOD_BENCH_LLVM_3="rustc example/mod_bench.rs --crate-type bin -Copt-level=3 -o target/out/mod_bench_llvm_3 -Cpanic=abort" # Use 100 runs, because a single compilations doesn't take more than ~150ms, so it isn't very slow -hyperfine --runs 100 "$COMPILE_MOD_BENCH_INLINE" "$COMPILE_MOD_BENCH_LLVM_0" "$COMPILE_MOD_BENCH_LLVM_1" "$COMPILE_MOD_BENCH_LLVM_2" "$COMPILE_MOD_BENCH_LLVM_3" +hyperfine --runs ${COMPILE_RUNS:-100} "$COMPILE_MOD_BENCH_INLINE" "$COMPILE_MOD_BENCH_LLVM_0" "$COMPILE_MOD_BENCH_LLVM_1" "$COMPILE_MOD_BENCH_LLVM_2" "$COMPILE_MOD_BENCH_LLVM_3" echo -echo "[Bench] mod_bench" -hyperfine ./target/out/mod_bench{,_inline} ./target/out/mod_bench_llvm_* +echo "[BENCH RUN] mod_bench" +hyperfine --runs ${RUN_RUNS:-10} ./target/out/mod_bench{,_inline} ./target/out/mod_bench_llvm_* cat target/out/log.txt | sort | uniq -c