aboutsummaryrefslogtreecommitdiff
path: root/performance-test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-04-24 14:46:18 -0300
committerDavid Bremner <david@tethera.net>2021-05-23 08:22:31 -0300
commit8cb30b08d8c9a650b8b5a98f4547b1b48e3f9d03 (patch)
tree3a8fd293f728a0121b90f90afc8b715057df6ff7 /performance-test
parentf2533b9e730c12276c32abe7126d7eabc7fcb8c6 (diff)
perf-test: add test for reindexing after removal/renaming msgs
At this point it is a bit tricky to measure the performance increase from the new message deletion code, since the same commit (9ad19e4) that improved the performance also seems to have fixed a bug with an uncaught Xapian exception triggered by this test.
Diffstat (limited to 'performance-test')
-rwxr-xr-xperformance-test/T03-reindex.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/performance-test/T03-reindex.sh b/performance-test/T03-reindex.sh
index 8db52a33..b58950d7 100755
--- a/performance-test/T03-reindex.sh
+++ b/performance-test/T03-reindex.sh
@@ -10,4 +10,32 @@ time_run 'reindex *' "notmuch reindex '*'"
time_run 'reindex *' "notmuch reindex '*'"
time_run 'reindex *' "notmuch reindex '*'"
+manifest=$(mktemp manifestXXXXXX)
+
+find mail -type f ! -path 'mail/.notmuch/*' | sed -n '1~4 p' > $manifest
+# arithmetic context is to eat extra whitespace on e.g. some BSDs
+count=$((`wc -l < $manifest`))
+
+xargs tar uf backup.tar < $manifest
+
+perl -nle 'rename $_, "$_.renamed"' $manifest
+
+time_run "reindex ($count mv)" "notmuch reindex '*'"
+
+perl -nle 'rename "$_.renamed", $_' $manifest
+
+time_run "reindex ($count mv back)" "notmuch reindex '*'"
+
+perl -nle 'unlink $_; unlink $_.copy' $manifest
+
+time_run "reindex ($count rm)" "notmuch reindex '*'"
+
+tar xf backup.tar
+
+time_run "reindex ($count restore)" "notmuch reindex '*'"
+
+perl -nle 'link $_, "$_.copy"' $manifest
+
+time_run "reindex ($count cp)" "notmuch reindex '*'"
+
time_done