From fc826a75257b528d0a555d470c8abb0aadc84da0 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 23 Nov 2019 15:10:29 +0100 Subject: [PATCH] Benchmark simple-raytracer compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [BENCH COMPILE] ebobby/simple-raytracer Benchmark #1: RUSTFLAGS='' cargo build --target x86_64-apple-darwin Time (mean ± σ): 16.539 s ± 0.781 s [User: 46.043 s, System: 3.822 s] Range (min … max): 15.057 s … 17.566 s 10 runs Benchmark #2: ../cargo.sh build Time (mean ± σ): 14.550 s ± 0.443 s [User: 25.856 s, System: 4.214 s] Range (min … max): 14.208 s … 15.751 s 10 runs Summary '../cargo.sh build' ran 1.14 ± 0.06 times faster than 'RUSTFLAGS='' cargo build --target x86_64-apple-darwin' [BENCH RUN] ebobby/simple-raytracer Benchmark #1: ./raytracer_cg_llvm Time (mean ± σ): 6.436 s ± 0.022 s [User: 6.392 s, System: 0.018 s] Range (min … max): 6.408 s … 6.466 s 10 runs Benchmark #2: ./raytracer_cg_clif Time (mean ± σ): 9.604 s ± 0.088 s [User: 9.547 s, System: 0.023 s] Range (min … max): 9.503 s … 9.742 s 10 runs Summary './raytracer_cg_llvm' ran 1.49 ± 0.01 times faster than './raytracer_cg_clif' --- test.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test.sh b/test.sh index 773b7c296d4..1f87c7203e3 100755 --- a/test.sh +++ b/test.sh @@ -66,10 +66,13 @@ $RUSTC example/mod_bench.rs --crate-type bin #./build_sysroot/build_sysroot.sh --release pushd simple-raytracer -echo "[BENCH] ebobby/simple-raytracer" -cargo clean && ../cargo.sh build -cp ./target/*/debug/main ./raytracer_cg_clif +echo "[BENCH COMPILE] ebobby/simple-raytracer" +hyperfine --runs ${RUN_RUNS:-10} --warmup 1 --prepare "rm -r target/*/debug" \ + "RUSTFLAGS='' cargo build --target $TARGET_TRIPLE" \ + "../cargo.sh build" +echo "[BENCH RUN] ebobby/simple-raytracer" +cp ./target/*/debug/main ./raytracer_cg_clif hyperfine --runs ${RUN_RUNS:-10} ./raytracer_cg_llvm ./raytracer_cg_clif popd