aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments/030-app-lifecycle/runs.sh
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-04 10:31:09 +0100
committereunhhu <[email protected]>2026-10-04 10:31:09 +0100
commit93261d1c157e50f1ed2bbc14cf68f2822553b69c (patch)
treea7f520cce249cb22425460371a8e73b461aebbd5 /research/experiments/030-app-lifecycle/runs.sh
parent71e319b63edfbe7e0c54f75e4cafa849d9ced28d (diff)
downloadpure-93261d1c157e50f1ed2bbc14cf68f2822553b69c.tar.gz
pure-93261d1c157e50f1ed2bbc14cf68f2822553b69c.zip
Measure how long an app changing module cannot answer, against a host restart (030)
An app of a million items (a list grown by doubling) or of a thousand, in a host of apps, its store in RAM: the longest gap between two answered writes while it changes module on SIGHUP (stopped and started again from its store, 71e319b), and while the host is restarted. A thousand items: 1.59 ms against 3.05 (median of 20 and 10). A million: 150.64 ms against 149.73 (10 and 5): both are the store read again (pure_app_start, 142 ms), so changing does not answer sooner than restarting.
Diffstat (limited to 'research/experiments/030-app-lifecycle/runs.sh')
-rwxr-xr-xresearch/experiments/030-app-lifecycle/runs.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/research/experiments/030-app-lifecycle/runs.sh b/research/experiments/030-app-lifecycle/runs.sh
new file mode 100755
index 0000000..601f754
--- /dev/null
+++ b/research/experiments/030-app-lifecycle/runs.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# The runs of research 115 (docs/design/017's stage 3), from the repository's
+# root, in steps, each under research/guard.py:
+# runs.sh build NAME COMMIT pure-serve of COMMIT, with its pure-crypto.so,
+# in ~/.cache/pure-030/NAME
+# runs.sh window NAME ITEMS CHANGES RESTARTS [MODULE] window.py on that
+# build, into DATE-window-NAME-ITEMS[-MODULE].jsonl
+set -e
+out=research/experiments/030-app-lifecycle
+builds=$HOME/.cache/pure-030
+day=$(date +%F)
+case "$1" in
+build)
+ rm -rf "$builds/src-$2"
+ git worktree add -f -q --detach "$builds/src-$2" "$3"
+ make -s -C "$builds/src-$2" build/pure-serve build/pure-crypto.so
+ mkdir -p "$builds/$2"
+ cp "$builds/src-$2/build/pure-serve" "$builds/src-$2/build/pure-crypto.so" "$builds/$2/"
+ git worktree remove --force "$builds/src-$2" ;;
+window)
+ until awk '{ exit !($1 < 1.5) }' /proc/loadavg; do sleep 10; done
+ python3 research/guard.py --most 2048 -- python3 $out/window.py "$builds/$2/pure-serve" "$3" "$4" "$5" ${6:+"$6"} \
+ > "$out/$day-window-$2-$3${6:+-$6}.jsonl" ;;
+*) echo "runs.sh build NAME COMMIT | window NAME ITEMS CHANGES RESTARTS [MODULE]" >&2; exit 2 ;;
+esac