mirror of
https://github.com/LemmyNet/lemmy.git
synced 2026-02-05 13:50:37 -06:00
* Fixing docker_update.sh script to not add context. Use docker build from a higher level to not load massive context. * Adding a custom postgresql for testing. * Fixing docker update * Fixing dir. * Fix rust log * Add bash / shell file format checking. * Adding shfmt package. * Running bash format. * Fixing bash fmt. * Fixing bash fmt 2. * Adding pgtune note.
24 lines
668 B
Bash
Executable File
24 lines
668 B
Bash
Executable File
#!/usr/bin/env 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 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"
|