aboutsummaryrefslogtreecommitdiff
path: root/performance-test/T05-ruby.sh
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2021-06-26 15:07:14 -0500
committerDavid Bremner <david@tethera.net>2021-07-18 16:50:27 -0300
commit02cf4a50bb531aab7afdb1b48ecc656211b791e8 (patch)
treecea90a6167eb12ccd86128ecb8843001b08002d2 /performance-test/T05-ruby.sh
parentd8a5fba4fe1efd7d0d652ead6d55371bc4078a9d (diff)
perf-test: add ruby test
Simply list the message-id of all the messages in a loop 100 times. Suggested-by: David Bremner <david@tethera.net> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Diffstat (limited to 'performance-test/T05-ruby.sh')
-rwxr-xr-xperformance-test/T05-ruby.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/performance-test/T05-ruby.sh b/performance-test/T05-ruby.sh
new file mode 100755
index 00000000..527ab28b
--- /dev/null
+++ b/performance-test/T05-ruby.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+test_description='ruby bindings'
+
+. $(dirname "$0")/perf-test-lib.sh || exit 1
+
+if [ "${NOTMUCH_HAVE_RUBY_DEV}" = "0" ]; then
+ echo "missing prerequisites: ruby development files"
+ exit 0
+fi
+
+time_start
+
+time_run 'print all messages' "$NOTMUCH_RUBY -I '$NOTMUCH_BUILDDIR/bindings/ruby' <<'EOF'
+require 'notmuch'
+db = Notmuch::Database.new('$MAIL_DIR')
+100.times.each do
+ db.query('').search_messages.each do |msg|
+ puts msg.message_id
+ end
+end
+EOF"
+
+time_done