]> git.notmuchmail.org Git - notmuch/commitdiff
perf-test: emacs tagging
authorDavid Bremner <david@tethera.net>
Sat, 12 Feb 2022 20:27:36 +0000 (16:27 -0400)
committerDavid Bremner <david@tethera.net>
Fri, 25 Feb 2022 12:38:21 +0000 (08:38 -0400)
Time tag operations, to see if it is worthwhile keeping both the
batch and the non-batch calls to notmuch tag.

performance-test/T06-emacs.sh [new file with mode: 0755]

diff --git a/performance-test/T06-emacs.sh b/performance-test/T06-emacs.sh
new file mode 100755 (executable)
index 0000000..66f0be5
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+test_description='emacs operations'
+
+. $(dirname "$0")/perf-test-lib.sh || exit 1
+. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1
+
+test_require_emacs
+
+time_start
+
+print_emacs_header
+
+MSGS=$(notmuch search --output=messages "*" | shuf -n 50 | awk '{printf " \"%s\"",$1}')
+
+time_emacs "tag messages" \
+"(dolist (msg (list $MSGS))
+   (notmuch-tag msg (list \"+test\"))
+   (notmuch-tag msg (list \"-test\"))))"
+
+time_done