[RFC PATCH v2 4/8] perf-test: inital emacs tests

Subject: [RFC PATCH v2 4/8] perf-test: inital emacs tests

Date: Sat, 29 Jan 2022 15:44:36 -0400

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


Time tag operations, to see if it is worthwhile keeping both the
batch and the none-batch calls to notmuch tag.
---
 performance-test/T06-emacs.sh | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100755 performance-test/T06-emacs.sh

diff --git a/performance-test/T06-emacs.sh b/performance-test/T06-emacs.sh
new file mode 100755
index 00000000..ca0b3ab5
--- /dev/null
+++ b/performance-test/T06-emacs.sh
@@ -0,0 +1,26 @@
+#!/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
+
+if [ "${NOTMUCH_with_EMACS}" = "0" ]; then
+    echo "notmuch was not configured with emacs"
+    exit 0
+fi
+
+time_start
+
+print_emacs_header
+
+MSGS=$(notmuch search --output=messages "*" | shuf -n 50 | awk '{printf " \"%s\"",$1}')
+
+test_emacs "(test-time
+ \"tag messages\"
+ (dolist (msg (list $MSGS))
+   (notmuch-tag msg (list \"+test\"))
+   (notmuch-tag msg (list \"-test\"))))
+"
+
+time_done
-- 
2.34.1

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: