Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a script to benchmark build times #2406

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions tools/bench_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Stop on first error
set -e

# Move to the correct directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "${DIR}/.."

echo dev profile: full build time
cargo clean
time cargo build -q

echo;echo;
echo dev profile: touch src/lib.rs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't do much.
If you add from the end a pub const FOO: usize = 42; (and then remove it after the build completes) does it have different results?

touch src/lib.rs
time cargo build -q

echo;echo;
echo release profile: full build time
cargo clean
time cargo build -q --release

echo;echo;
echo release profile: touch src/lib.rs
touch src/lib.rs
time cargo build -q --release