[PATCH] performance-tests: tests for renamed/copied files in notmuch new
David Bremner
david at tethera.net
Tue Apr 2 05:40:11 PDT 2019
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.
---
performance-test/T00-new.sh | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
I added these tests to help evaluate Michael's propesed patch. I'll send the results in a seperate email.
diff --git a/performance-test/T00-new.sh b/performance-test/T00-new.sh
index 68750129..cec28d58 100755
--- a/performance-test/T00-new.sh
+++ b/performance-test/T00-new.sh
@@ -12,4 +12,34 @@ for i in $(seq 2 6); do
time_run "notmuch new #$i" 'notmuch new'
done
+manifest=$(mktemp manifestXXXXXX)
+
+count=0
+total=0
+while read -r name ; do
+ if [ $((total % 4 )) -eq 0 ]; then
+ echo $name >> $manifest
+ count=$((count + 1))
+ fi
+ total=$((total + 1))
+done < <(find mail -type f ! -path 'mail/.notmuch/*' )
+
+while read -r name ; do
+ mv $name ${name}.renamed
+done < $manifest
+
+time_run "new ($count mv)" 'notmuch new'
+
+while read -r name ; do
+ mv ${name}.renamed $name
+done < $manifest
+
+time_run "new ($count mv back)" 'notmuch new'
+
+while read -r name ; do
+ cp ${name} $name.copy
+done < $manifest
+
+time_run "new ($count cp)" 'notmuch new'
+
time_done
--
2.20.1
More information about the notmuch
mailing list