about summary refs log tree commit diff stats
path: root/bench
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-22 14:19:42 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-22 14:19:42 +0200
commit72acfb93627918f6fc9c68a5bf5b4ecf34d07a23 (patch)
treee59a493e573b05a4fc5a09f3c6d2702635410bec /bench
parentperf(raw_update.py)!: Don't fetch entries that are already in the database (diff)
downloadyt-72acfb93627918f6fc9c68a5bf5b4ecf34d07a23.tar.gz
yt-72acfb93627918f6fc9c68a5bf5b4ecf34d07a23.zip
test(benches/update): Init
Diffstat (limited to 'bench')
-rwxr-xr-xbench/update.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/bench/update.sh b/bench/update.sh
new file mode 100755
index 0000000..d4799bc
--- /dev/null
+++ b/bench/update.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env sh
+
+root="$(git rev-parse --show-toplevel)"
+cd "$root" || {
+    echo "There seems to be no root?" 2>&1
+    exit 1
+}
+
+db_dir="$(mktemp -d)"
+db="$db_dir/db.sqlite"
+
+[ "$1" = "--keep" ] || cargo build --profile=profiling
+
+./target/profiling/yt --db-path "$db" subscriptions add --name 'Kurzgesagt – In a Nutshell - Videos' 'https://www.youtube.com/@kurzgesagt/videos/'
+./target/profiling/yt --db-path "$db" update --max-backlog 20 --subscriptions="Kurzgesagt – In a Nutshell - Videos"
+
+hyperfine --show-output --max-runs 5 --min-runs 3 -- "./target/profiling/yt --db-path '$db' update --max-backlog 20 --subscriptions='Kurzgesagt – In a Nutshell - Videos'"
+
+rm "$db"
+rm --directory "$db_dir"
+# vim: ft=sh