Fossil SCM

Improved throw-away cache speedup test scripts.

danshearer 2026-09-29 08:26 UTC cache-speedups
Commit 2266da94efb3ed7034ce5c1d9362d8ff8f20ff4becce42a9cfae9d4e2734f8b4
--- cache-speedups-test/export.sh
+++ cache-speedups-test/export.sh
@@ -1,8 +1,17 @@
1
-sudo -v
2
-for n in 500 2000 5000; do
3
- echo "cache_n=$n" ; export FOSSIL_CACHE_N=$n
4
- export FOSSIL_CACHE_SZ=250000000 # This needs to be high but otherwise doesnt matter
5
- cp sqlite.fossil /tmp/sqlite.fossil
6
- sync; echo 3 | sudo tee /proc/sys/vm/drop_caches > /dev/null # Linux only
7
- time ../fossil export -R /tmp/sqlite.fossil > /dev/null
1
+#!/bin/sh
2
+# Throw-away cache size test scripts by Dan Shearer, Sep 2026
3
+# Needs ../fossil built from the cache-speedups branch
4
+set -eu
5
+unset FOSSIL_SQLCACHE
6
+
7
+repository=${1:?usage: $0 repository.fossil}
8
+copy=${TMPDIR:-/tmp}/${repository##*/}
9
+printf 'command\trepetition\tcache_n\telapsed\tuser\tsystem\tmax_rss_kb\n'
10
+for repetition in $(seq 1 "${REPEATS:-3}"); do
11
+ for n in $(printf '%s\n' ${CACHE_VALUES:-500 1000 1500 2000 3000 5000} | shuf); do
12
+ export FOSSIL_CACHE_N=$n FOSSIL_CACHE_SZ=${CACHE_SZ:-1000000000}
13
+ cp "$repository" "$copy"
14
+ /usr/bin/time -f "export\t$repetition\t$n\t%e\t%U\t%S\t%M" \
15
+ ../fossil export -R "$copy" >/dev/null
16
+ done
817
done
918
1019
ADDED cache-speedups-test/git-export.sh
--- cache-speedups-test/export.sh
+++ cache-speedups-test/export.sh
@@ -1,8 +1,17 @@
1 sudo -v
2 for n in 500 2000 5000; do
3 echo "cache_n=$n" ; export FOSSIL_CACHE_N=$n
4 export FOSSIL_CACHE_SZ=250000000 # This needs to be high but otherwise doesnt matter
5 cp sqlite.fossil /tmp/sqlite.fossil
6 sync; echo 3 | sudo tee /proc/sys/vm/drop_caches > /dev/null # Linux only
7 time ../fossil export -R /tmp/sqlite.fossil > /dev/null
 
 
 
 
 
 
 
 
 
8 done
9
10 DDED cache-speedups-test/git-export.sh
--- cache-speedups-test/export.sh
+++ cache-speedups-test/export.sh
@@ -1,8 +1,17 @@
1 #!/bin/sh
2 # Throw-away cache size test scripts by Dan Shearer, Sep 2026
3 # Needs ../fossil built from the cache-speedups branch
4 set -eu
5 unset FOSSIL_SQLCACHE
6
7 repository=${1:?usage: $0 repository.fossil}
8 copy=${TMPDIR:-/tmp}/${repository##*/}
9 printf 'command\trepetition\tcache_n\telapsed\tuser\tsystem\tmax_rss_kb\n'
10 for repetition in $(seq 1 "${REPEATS:-3}"); do
11 for n in $(printf '%s\n' ${CACHE_VALUES:-500 1000 1500 2000 3000 5000} | shuf); do
12 export FOSSIL_CACHE_N=$n FOSSIL_CACHE_SZ=${CACHE_SZ:-1000000000}
13 cp "$repository" "$copy"
14 /usr/bin/time -f "export\t$repetition\t$n\t%e\t%U\t%S\t%M" \
15 ../fossil export -R "$copy" >/dev/null
16 done
17 done
18
19 DDED cache-speedups-test/git-export.sh
--- a/cache-speedups-test/git-export.sh
+++ b/cache-speedups-test/git-export.sh
@@ -0,0 +1,27 @@
1
+#!/bin/sh
2
+# Throw-away cache size test scripts by Dan Shearer, Sep 2026
3
+# Needs ../fossil built from the cache-speedups branch
4
+set -eu
5
+unset FOSSIL_SQLCACHE
6
+
7
+repository=${1:?usage: $0 repository.fossil}
8
+copy=${TMPDIR:-/tmp}/${repository##*/}
9
+mirror=$PWD/git-export-mirror
10
+trap 'rm -rf "$mirror" "$copy"' EXIT HUP INT TERM
11
+printf 'command\trepetition\tcache_n\telapsed\tuser\tsystem\tmax_rss_kb\n'
12
+cache_values=${CACHE_VALUES:-"500 1000 1500 2000 3000 5000"}
13
+if [ -n "${GIT_LIMIT:-}" ]; then
14
+ set -- --limit "$GIT_LIMIT"
15
+else
16
+ set --
17
+fi
18
+for repetition in $(seq 1 "${REPEATS:-3}"); do
19
+ for n in $(printf '%s\n' $cache_values | shuf); do
20
+ export FOSSIL_CACHE_N=$n FOSSIL_CACHE_SZ=${CACHE_SZ:-1000000000}
21
+ rm -rf "$mirror"
22
+ git init -q "$mirror"
23
+ cp "$repository" "$copy"
24
+ /usr/bin/time -f "git-export\t$repetition\t$n\t%e\t%U\t%S\t%M" \
25
+ ../fossil git export "$mirror" -R "$copy" "$@" -q -q
26
+ done
27
+done
--- a/cache-speedups-test/git-export.sh
+++ b/cache-speedups-test/git-export.sh
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/cache-speedups-test/git-export.sh
+++ b/cache-speedups-test/git-export.sh
@@ -0,0 +1,27 @@
1 #!/bin/sh
2 # Throw-away cache size test scripts by Dan Shearer, Sep 2026
3 # Needs ../fossil built from the cache-speedups branch
4 set -eu
5 unset FOSSIL_SQLCACHE
6
7 repository=${1:?usage: $0 repository.fossil}
8 copy=${TMPDIR:-/tmp}/${repository##*/}
9 mirror=$PWD/git-export-mirror
10 trap 'rm -rf "$mirror" "$copy"' EXIT HUP INT TERM
11 printf 'command\trepetition\tcache_n\telapsed\tuser\tsystem\tmax_rss_kb\n'
12 cache_values=${CACHE_VALUES:-"500 1000 1500 2000 3000 5000"}
13 if [ -n "${GIT_LIMIT:-}" ]; then
14 set -- --limit "$GIT_LIMIT"
15 else
16 set --
17 fi
18 for repetition in $(seq 1 "${REPEATS:-3}"); do
19 for n in $(printf '%s\n' $cache_values | shuf); do
20 export FOSSIL_CACHE_N=$n FOSSIL_CACHE_SZ=${CACHE_SZ:-1000000000}
21 rm -rf "$mirror"
22 git init -q "$mirror"
23 cp "$repository" "$copy"
24 /usr/bin/time -f "git-export\t$repetition\t$n\t%e\t%U\t%S\t%M" \
25 ../fossil git export "$mirror" -R "$copy" "$@" -q -q
26 done
27 done
--- cache-speedups-test/rebuild.sh
+++ cache-speedups-test/rebuild.sh
@@ -1,7 +1,16 @@
1
-sudo -v
2
-for n in 0 -32000 -256000; do
3
- echo "sqlcache=$n" ; export FOSSIL_SQLCACHE=$n
4
- cp sqlite.fossil /tmp/sqlite.fossil
5
- sync; echo 3 | sudo tee /proc/sys/vm/drop_caches > /dev/null # Linux only
6
- time ../fossil rebuild /tmp/sqlite.fossil
1
+#!/bin/sh
2
+# Throw-away cache size test scripts by Dan Shearer, Sep 2026
3
+# Needs ../fossil built from the cache-speedups branch
4
+set -eu
5
+
6
+repository=${1:?usage: $0 repository.fossil}
7
+copy=${TMPDIR:-/tmp}/${repository##*/}
8
+printf 'command\trepetition\tsqlcache_kib\telapsed\tuser\tsystem\tmax_rss_kb\n'
9
+for repetition in $(seq 1 "${REPEATS:-3}"); do
10
+ for n in $(printf '%s\n' ${CACHE_VALUES:-0 -16000 -24000 -32000 -64000} | shuf); do
11
+ export FOSSIL_SQLCACHE=$n
12
+ cp "$repository" "$copy"
13
+ /usr/bin/time -f "rebuild\t$repetition\t$n\t%e\t%U\t%S\t%M" \
14
+ ../fossil rebuild "$copy" --quiet
15
+ done
716
done
817
--- cache-speedups-test/rebuild.sh
+++ cache-speedups-test/rebuild.sh
@@ -1,7 +1,16 @@
1 sudo -v
2 for n in 0 -32000 -256000; do
3 echo "sqlcache=$n" ; export FOSSIL_SQLCACHE=$n
4 cp sqlite.fossil /tmp/sqlite.fossil
5 sync; echo 3 | sudo tee /proc/sys/vm/drop_caches > /dev/null # Linux only
6 time ../fossil rebuild /tmp/sqlite.fossil
 
 
 
 
 
 
 
 
 
7 done
8
--- cache-speedups-test/rebuild.sh
+++ cache-speedups-test/rebuild.sh
@@ -1,7 +1,16 @@
1 #!/bin/sh
2 # Throw-away cache size test scripts by Dan Shearer, Sep 2026
3 # Needs ../fossil built from the cache-speedups branch
4 set -eu
5
6 repository=${1:?usage: $0 repository.fossil}
7 copy=${TMPDIR:-/tmp}/${repository##*/}
8 printf 'command\trepetition\tsqlcache_kib\telapsed\tuser\tsystem\tmax_rss_kb\n'
9 for repetition in $(seq 1 "${REPEATS:-3}"); do
10 for n in $(printf '%s\n' ${CACHE_VALUES:-0 -16000 -24000 -32000 -64000} | shuf); do
11 export FOSSIL_SQLCACHE=$n
12 cp "$repository" "$copy"
13 /usr/bin/time -f "rebuild\t$repetition\t$n\t%e\t%U\t%S\t%M" \
14 ../fossil rebuild "$copy" --quiet
15 done
16 done
17
--- cache-speedups-test/test-integrity.sh
+++ cache-speedups-test/test-integrity.sh
@@ -1,8 +1,17 @@
1
-sudo -v
2
-for n in 500 2000 5000; do
3
- echo "cache_n=$n" ; export FOSSIL_CACHE_N=$n
4
- export FOSSIL_CACHE_SZ=250000000 # This needs to be high but otherwise doesnt matter
5
- cp sqlite.fossil /tmp/sqlite.fossil
6
- sync; echo 3 | sudo tee /proc/sys/vm/drop_caches > /dev/null # Linux only
7
- time ../fossil test-integrity -R /tmp/sqlite.fossil > /dev/null
1
+#!/bin/sh
2
+# Throw-away cache size test scripts by Dan Shearer, Sep 2026
3
+# Needs ../fossil built from the cache-speedups branch
4
+set -eu
5
+unset FOSSIL_SQLCACHE
6
+
7
+repository=${1:?usage: $0 repository.fossil}
8
+copy=${TMPDIR:-/tmp}/${repository##*/}
9
+printf 'command\trepetition\tcache_n\telapsed\tuser\tsystem\tmax_rss_kb\n'
10
+for repetition in $(seq 1 "${REPEATS:-3}"); do
11
+ for n in $(printf '%s\n' ${CACHE_VALUES:-500 1000 1500 2000 3000 5000} | shuf); do
12
+ export FOSSIL_CACHE_N=$n FOSSIL_CACHE_SZ=${CACHE_SZ:-1000000000}
13
+ cp "$repository" "$copy"
14
+ /usr/bin/time -f "test-integrity\t$repetition\t$n\t%e\t%U\t%S\t%M" \
15
+ ../fossil test-integrity -R "$copy" >/dev/null
16
+ done
817
done
918
--- cache-speedups-test/test-integrity.sh
+++ cache-speedups-test/test-integrity.sh
@@ -1,8 +1,17 @@
1 sudo -v
2 for n in 500 2000 5000; do
3 echo "cache_n=$n" ; export FOSSIL_CACHE_N=$n
4 export FOSSIL_CACHE_SZ=250000000 # This needs to be high but otherwise doesnt matter
5 cp sqlite.fossil /tmp/sqlite.fossil
6 sync; echo 3 | sudo tee /proc/sys/vm/drop_caches > /dev/null # Linux only
7 time ../fossil test-integrity -R /tmp/sqlite.fossil > /dev/null
 
 
 
 
 
 
 
 
 
8 done
9
--- cache-speedups-test/test-integrity.sh
+++ cache-speedups-test/test-integrity.sh
@@ -1,8 +1,17 @@
1 #!/bin/sh
2 # Throw-away cache size test scripts by Dan Shearer, Sep 2026
3 # Needs ../fossil built from the cache-speedups branch
4 set -eu
5 unset FOSSIL_SQLCACHE
6
7 repository=${1:?usage: $0 repository.fossil}
8 copy=${TMPDIR:-/tmp}/${repository##*/}
9 printf 'command\trepetition\tcache_n\telapsed\tuser\tsystem\tmax_rss_kb\n'
10 for repetition in $(seq 1 "${REPEATS:-3}"); do
11 for n in $(printf '%s\n' ${CACHE_VALUES:-500 1000 1500 2000 3000 5000} | shuf); do
12 export FOSSIL_CACHE_N=$n FOSSIL_CACHE_SZ=${CACHE_SZ:-1000000000}
13 cp "$repository" "$copy"
14 /usr/bin/time -f "test-integrity\t$repetition\t$n\t%e\t%U\t%S\t%M" \
15 ../fossil test-integrity -R "$copy" >/dev/null
16 done
17 done
18

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button