]> Untitled Git - lemmy.git/commitdiff
Add compilation benchmark, move scripts into subfolder
authorFelix Ableitner <me@nutomic.com>
Thu, 14 Jan 2021 16:51:38 +0000 (17:51 +0100)
committerFelix Ableitner <me@nutomic.com>
Thu, 14 Jan 2021 17:04:01 +0000 (18:04 +0100)
clean.sh [deleted file]
scripts/compilation_benchmark.sh [new file with mode: 0755]
scripts/db-init.sh [moved from db-init.sh with 100% similarity]
scripts/install.sh [moved from install.sh with 100% similarity]
scripts/query_testing/apache_bench_report.sh [moved from query_testing/apache_bench_report.sh with 100% similarity]
scripts/query_testing/api_benchmark.sh [moved from query_testing/api_benchmark.sh with 100% similarity]
scripts/query_testing/views_old/generate_reports.sh [moved from query_testing/views_old/generate_reports.sh with 100% similarity]
scripts/query_testing/views_old/timings-2021-01-05_21-06-37.out [moved from query_testing/views_old/timings-2021-01-05_21-06-37.out with 100% similarity]
scripts/query_testing/views_to_diesel_migration/generate_reports.sh [moved from query_testing/views_to_diesel_migration/generate_reports.sh with 100% similarity]
scripts/query_testing/views_to_diesel_migration/timings-2021-01-05_21-32-54.out [moved from query_testing/views_to_diesel_migration/timings-2021-01-05_21-32-54.out with 100% similarity]
scripts/test.sh [moved from test.sh with 100% similarity]

diff --git a/clean.sh b/clean.sh
deleted file mode 100755 (executable)
index 3666a72..0000000
--- a/clean.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-cargo update
-cargo fmt
-cargo check
-cargo clippy
-cargo outdated -R
diff --git a/scripts/compilation_benchmark.sh b/scripts/compilation_benchmark.sh
new file mode 100755 (executable)
index 0000000..7600379
--- /dev/null
@@ -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"
\ No newline at end of file
similarity index 100%
rename from db-init.sh
rename to scripts/db-init.sh
similarity index 100%
rename from install.sh
rename to scripts/install.sh
similarity index 100%
rename from test.sh
rename to scripts/test.sh