mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-24 00:40:32 +00:00
Add compilation benchmark, move scripts into subfolder
This commit is contained in:
parent
0c932e3ace
commit
5c198ea85d
11 changed files with 23 additions and 7 deletions
7
clean.sh
7
clean.sh
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
cargo update
|
||||
cargo fmt
|
||||
cargo check
|
||||
cargo clippy
|
||||
cargo outdated -R
|
23
scripts/compilation_benchmark.sh
Executable file
23
scripts/compilation_benchmark.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
times=3
|
||||
duration=0
|
||||
for ((i=0; i < times; i++)) ; do
|
||||
echo "Starting iteration $i"
|
||||
echo "cargo clean"
|
||||
# to benchmark incremental compilation time, do a full build with the same compiler version first,
|
||||
# and use the following clean command:
|
||||
#cargo clean -p lemmy_utils
|
||||
cargo clean
|
||||
echo "cargo build"
|
||||
start=$(date +%s.%N)
|
||||
RUSTC_WRAPPER='' cargo +1.47.0 build -q
|
||||
end=$(date +%s.%N)
|
||||
echo "Finished iteration $i after $(bc <<< "scale=0; $end - $start") seconds"
|
||||
duration=$(bc <<< "$duration + $end - $start")
|
||||
done
|
||||
|
||||
average=$(bc <<< "scale=0; $duration / $times")
|
||||
|
||||
echo "Average compilation time over $times runs is $average seconds"
|
Loading…
Reference in a new issue