summaryrefslogtreecommitdiffstats
path: root/performance-test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2019-04-01 07:31:51 -0300
committerDavid Bremner <david@tethera.net>2019-04-05 12:14:58 -0300
commita56aa472d176d08ba6d175762f673efc345116fa (patch)
tree23e84d59b2c1c6e469cff62e6b8894f12063d344 /performance-test
parent8e584392dce53d322b9403306991944c5578b1f0 (diff)
performance-tests: tests for renamed/copied files in notmuch new
Several people have observed that this is surprisingly slow, and we have a proposal to add tagging into this code path, so we want to make sure it doesn't imply too much of a performance hit.
Diffstat (limited to 'performance-test')
-rwxr-xr-xperformance-test/T00-new.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/performance-test/T00-new.sh b/performance-test/T00-new.sh
index 68750129..25391136 100755
--- a/performance-test/T00-new.sh
+++ b/performance-test/T00-new.sh
@@ -12,4 +12,22 @@ for i in $(seq 2 6); do
time_run "notmuch new #$i" 'notmuch new'
done
+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`))
+
+perl -nle 'rename $_, "$_.renamed"' $manifest
+
+time_run "new ($count mv)" 'notmuch new'
+
+perl -nle 'rename "$_.renamed", $_' $manifest
+
+time_run "new ($count mv back)" 'notmuch new'
+
+perl -nle 'link $_, "$_.copy"' $manifest
+
+time_run "new ($count cp)" 'notmuch new'
+
time_done