From 2cd8ccbea17524d563a2120964ff5fe42dfba61b Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Fri, 18 Sep 2020 14:45:52 +0200 Subject: [PATCH] Don't benchmark mod_bench anymore --- example/mod_bench.rs | 2 +- test.sh | 19 ++----------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/example/mod_bench.rs b/example/mod_bench.rs index 95bcad2cd17..bc652213623 100644 --- a/example/mod_bench.rs +++ b/example/mod_bench.rs @@ -20,7 +20,7 @@ unsafe extern "C" fn _Unwind_Resume() { #[start] fn main(_argc: isize, _argv: *const *const u8) -> isize { - for i in 2..100_000_000 { + for i in 2..10_000_000 { black_box((i + 1) % i); } diff --git a/test.sh b/test.sh index 67dd4d3aa00..055ebfd8c72 100755 --- a/test.sh +++ b/test.sh @@ -73,8 +73,9 @@ echo "[AOT] track-caller-attribute" $RUSTC example/track-caller-attribute.rs --crate-type bin -Cpanic=abort --target $TARGET_TRIPLE $RUN_WRAPPER ./target/out/track-caller-attribute -echo "[BUILD] mod_bench" +echo "[AOT] mod_bench" $RUSTC example/mod_bench.rs --crate-type bin --target $TARGET_TRIPLE +$RUN_WRAPPER ./target/out/mod_bench pushd rand rm -r ./target || true @@ -116,19 +117,3 @@ diff -u res.txt examples/regexdna-output.txt 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" -COMPILE_MOD_BENCH_LLVM_2="rustc example/mod_bench.rs --crate-type bin -Copt-level=2 -o target/out/mod_bench_llvm_2 -Cpanic=abort" -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 ${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 RUN] mod_bench" -hyperfine --runs ${RUN_RUNS:-10} ./target/out/mod_bench{,_inline} ./target/out/mod_bench_llvm_*