Skip to content

Commit 2cd8ccb

Browse files
committed
Don't benchmark mod_bench anymore
1 parent 552991e commit 2cd8ccb

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

example/mod_bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ unsafe extern "C" fn _Unwind_Resume() {
2020

2121
#[start]
2222
fn main(_argc: isize, _argv: *const *const u8) -> isize {
23-
for i in 2..100_000_000 {
23+
for i in 2..10_000_000 {
2424
black_box((i + 1) % i);
2525
}
2626

test.sh

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ echo "[AOT] track-caller-attribute"
7373
$RUSTC example/track-caller-attribute.rs --crate-type bin -Cpanic=abort --target $TARGET_TRIPLE
7474
$RUN_WRAPPER ./target/out/track-caller-attribute
7575

76-
echo "[BUILD] mod_bench"
76+
echo "[AOT] mod_bench"
7777
$RUSTC example/mod_bench.rs --crate-type bin --target $TARGET_TRIPLE
78+
$RUN_WRAPPER ./target/out/mod_bench
7879

7980
pushd rand
8081
rm -r ./target || true
@@ -116,19 +117,3 @@ diff -u res.txt examples/regexdna-output.txt
116117
echo "[TEST] rust-lang/regex tests"
117118
../cargo.sh test --tests -- --exclude-should-panic --test-threads 1 -Zunstable-options
118119
popd
119-
120-
echo
121-
echo "[BENCH COMPILE] mod_bench"
122-
123-
COMPILE_MOD_BENCH_INLINE="$RUSTC example/mod_bench.rs --crate-type bin -Zmir-opt-level=3 -O --crate-name mod_bench_inline"
124-
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"
125-
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"
126-
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"
127-
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"
128-
129-
# Use 100 runs, because a single compilations doesn't take more than ~150ms, so it isn't very slow
130-
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"
131-
132-
echo
133-
echo "[BENCH RUN] mod_bench"
134-
hyperfine --runs ${RUN_RUNS:-10} ./target/out/mod_bench{,_inline} ./target/out/mod_bench_llvm_*

0 commit comments

Comments
 (0)