1 Return-Path: <amdragon@mit.edu>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 10A75431FAF
\r
6 for <notmuch@notmuchmail.org>; Sun, 25 Nov 2012 13:40:29 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id hwi1UAfsSmTO for <notmuch@notmuchmail.org>;
\r
16 Sun, 25 Nov 2012 13:40:28 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id D1AEB431FAE
\r
20 for <notmuch@notmuchmail.org>; Sun, 25 Nov 2012 13:40:27 -0800 (PST)
\r
21 X-AuditID: 1209190d-b7f906d0000008de-d4-50b2904b98d3
\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])
\r
23 by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 88.19.02270.B4092B05; Sun, 25 Nov 2012 16:40:27 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id qAPLeQR9008328;
\r
27 Sun, 25 Nov 2012 16:40:26 -0500
\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qAPLeOjh003344
\r
32 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
\r
33 Sun, 25 Nov 2012 16:40:25 -0500 (EST)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)
\r
35 (envelope-from <amdragon@mit.edu>)
\r
36 id 1Tcjw8-0004MD-13; Sun, 25 Nov 2012 16:40:24 -0500
\r
37 Date: Sun, 25 Nov 2012 16:40:24 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: david@tethera.net
\r
40 Subject: Re: [Patch v4 2/2] test: initial performance testing infrastructure
\r
41 Message-ID: <20121125214023.GO4562@mit.edu>
\r
42 References: <1353855745-11697-1-git-send-email-david@tethera.net>
\r
43 <1353855745-11697-3-git-send-email-david@tethera.net>
\r
45 Content-Type: text/plain; charset=us-ascii
\r
46 Content-Disposition: inline
\r
47 In-Reply-To: <1353855745-11697-3-git-send-email-david@tethera.net>
\r
48 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
49 X-Brightmail-Tracker:
\r
50 H4sIAAAAAAAAA+NgFprBKsWRmVeSWpSXmKPExsUixG6nrus9YVOAwb1WUYuNy34yW9xo7Wa0
\r
51 uH5zJrMDs8evtrnMHs9W3WL22HLoPXMAcxSXTUpqTmZZapG+XQJXxsKDx5gKOkMqVnd3MzUw
\r
52 vnXsYuTkkBAwkZj7djsThC0mceHeerYuRi4OIYF9jBJ9a5exgySEBDYwSrw+xwuRuMgkce/Q
\r
53 TDaIxBJGiVkvM0BsFgFVicaFB1hBbDYBDYlt+5czgtgiAqISpzdNAoszC9hLLJo9CWyosICP
\r
54 xLlds8A28wpoS0y98R9qWaXE5/mvmSHighInZz5hgejVkrjx7yVQPQeQLS2x/B8HSJhTwEli
\r
55 zpoNYCWiAioSU05uY5vAKDQLSfcsJN2zELoXMDKvYpRNya3SzU3MzClOTdYtTk7My0st0jXS
\r
56 y80s0UtNKd3ECAp0TkneHYzvDiodYhTgYFTi4b2RuDFAiDWxrLgy9xCjJAeTkihvc+umACG+
\r
57 pPyUyozE4oz4otKc1OJDjBIczEoivBOZgHK8KYmVValF+TApaQ4WJXHeKyk3/YUE0hNLUrNT
\r
58 UwtSi2CyMhwcShK8Bv1AjYJFqempFWmZOSUIaSYOTpDhPEDDU0BqeIsLEnOLM9Mh8qcYdTl6
\r
59 /3U9YRRiycvPS5US57UFKRIAKcoozYObA0tQrxjFgd4S5k0GqeIBJje4Sa+AljABLUm+vhFk
\r
60 SUkiQkqqgbHzq6PKyh2L695Gad5t7bvtzfK93InNsS7av7Ct5eb+j3t94ufzFlW9vxb1R2aL
\r
61 v48d0/EHf1J6F975c13U1El6zr+yy4Y2xWwegZ8XmVauLGB5t+Tkkdtzs9xkZLcvcplQt2v5
\r
62 moz2L43/2nZ/E/15xEpt93KxEwrPl7xmnZp/Qyq674F24mwlluKMREMt5qLiRACFNW0uKwMA AA==
\r
63 Cc: notmuch@notmuchmail.org, David Bremner <bremner@debian.org>
\r
64 X-BeenThere: notmuch@notmuchmail.org
\r
65 X-Mailman-Version: 2.1.13
\r
67 List-Id: "Use and development of the notmuch mail system."
\r
68 <notmuch.notmuchmail.org>
\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
72 List-Post: <mailto:notmuch@notmuchmail.org>
\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
75 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
76 X-List-Received-Date: Sun, 25 Nov 2012 21:40:29 -0000
\r
78 Quoth david@tethera.net on Nov 25 at 11:02 am:
\r
79 > From: David Bremner <bremner@debian.org>
\r
81 > This is not near as fancy as as the unit tests, on the theory that
\r
82 > the code should typically be crashing when performance tuning.
\r
83 > Nonetheless, there is plenty of room for improvement. Several more of
\r
84 > the pieces of the test infrastructure (e.g. the option parsing) could
\r
85 > be factored out into test/test-lib-common.sh
\r
88 > performance-test/.gitignore | 1 +
\r
89 > performance-test/Makefile | 7 +++
\r
90 > performance-test/Makefile.local | 32 ++++++++++
\r
91 > performance-test/README | 50 +++++++++++++++
\r
92 > performance-test/basic | 15 +++++
\r
93 > performance-test/download/.gitignore | 2 +
\r
94 > .../download/notmuch-email-corpus-0.2.tar.xz.asc | 9 +++
\r
95 > performance-test/notmuch-perf-test | 25 ++++++++
\r
96 > performance-test/perf-test-lib.sh | 65 ++++++++++++++++++++
\r
97 > performance-test/version.sh | 3 +
\r
98 > 11 files changed, 211 insertions(+), 1 deletion(-)
\r
99 > create mode 100644 performance-test/.gitignore
\r
100 > create mode 100644 performance-test/Makefile
\r
101 > create mode 100644 performance-test/Makefile.local
\r
102 > create mode 100644 performance-test/README
\r
103 > create mode 100755 performance-test/basic
\r
104 > create mode 100644 performance-test/download/.gitignore
\r
105 > create mode 100644 performance-test/download/notmuch-email-corpus-0.2.tar.xz.asc
\r
106 > create mode 100755 performance-test/notmuch-perf-test
\r
107 > create mode 100644 performance-test/perf-test-lib.sh
\r
108 > create mode 100644 performance-test/version.sh
\r
110 > diff --git a/Makefile b/Makefile
\r
111 > index bb9c316..5decbea 100644
\r
117 > # List all subdirectories here. Each contains its own Makefile.local
\r
118 > -subdirs = compat completion emacs lib man parse-time-string util test
\r
119 > +subdirs := compat completion emacs lib man parse-time-string
\r
120 > +subdirs := $(subdirs) performance-test util test
\r
125 > # We make all targets depend on the Makefiles themselves.
\r
126 > global_deps = Makefile Makefile.config Makefile.local \
\r
127 > diff --git a/performance-test/.gitignore b/performance-test/.gitignore
\r
128 > new file mode 100644
\r
129 > index 0000000..53f2697
\r
131 > +++ b/performance-test/.gitignore
\r
134 > diff --git a/performance-test/Makefile b/performance-test/Makefile
\r
135 > new file mode 100644
\r
136 > index 0000000..de492a7
\r
138 > +++ b/performance-test/Makefile
\r
140 > +# See Makefile.local for the list of files to be compiled in this
\r
143 > + $(MAKE) -C .. all
\r
146 > + $(MAKE) -C .. $@
\r
147 > diff --git a/performance-test/Makefile.local b/performance-test/Makefile.local
\r
148 > new file mode 100644
\r
149 > index 0000000..1114ec1
\r
151 > +++ b/performance-test/Makefile.local
\r
153 > +# -*- makefile -*-
\r
155 > +dir := performance-test
\r
157 > +include $(dir)/version.sh
\r
159 > +CORPUS_NAME := notmuch-email-corpus-$(PERFTEST_VERSION).tar.xz
\r
161 Would it make sense to split out the different size corpora so a user
\r
162 could, say, only download the small one?
\r
164 > +TXZFILE := ${dir}/download/${CORPUS_NAME}
\r
165 > +SIGFILE := ${TXZFILE}.asc
\r
166 > +TEST_SCRIPT := ${dir}/notmuch-perf-test
\r
167 > +DEFAULT_URL := http://notmuchmail.org/releases/${CORPUS_NAME}
\r
169 > +perf-test: setup-perf-test all
\r
170 > + $(TEST_SCRIPT) $(OPTIONS)
\r
172 > +.PHONY: download-corpus setup-perf-test
\r
174 > +# Note that this intentionally does not depend on download-corpus.
\r
175 > +setup-perf-test: $(TXZFILE)
\r
176 > + gpg --verify $(SIGFILE)
\r
179 > + @printf "\nPlease download ${TXZFILE}.\n\n"
\r
181 "\nPlease download ${TXZFILE} using\n\n"?
\r
183 > + @printf "\t%% make download-corpus\n\n"
\r
184 > + @echo or see http://notmuchmail.org/corpus for download locations
\r
188 > +download-corpus:
\r
189 > + wget -O ${TXZFILE} ${DEFAULT_URL}
\r
191 > +CLEAN := $(CLEAN) $(dir)/tmp.*
\r
192 > diff --git a/performance-test/README b/performance-test/README
\r
193 > new file mode 100644
\r
194 > index 0000000..239d2fb
\r
196 > +++ b/performance-test/README
\r
201 > +In addition to having notmuch, you need:
\r
206 > +- xz. Some speedup can be gotten by installing "pixz", but this is
\r
207 > + probably only worthwhile if you are debugging the tests.
\r
209 > +Getting set up to run tests:
\r
210 > +----------------------------
\r
212 > +First, you need to get the corpus.
\r
214 > +It should work to run
\r
216 > + % make download-corpus
\r
218 > +In case that fails or is too slow, check
\r
220 > + http://notmuchmail.org/corpus
\r
222 > +for a list of mirrors.
\r
227 > +The easiest way to run performance tests is to say "make perf-test", (or
\r
228 > +simply run the notmuch-perf-test script). Either command will run all
\r
229 > +available performance tests.
\r
231 > +Alternately, you can run a specific subset of tests by simply invoking
\r
232 > +one of the executable scripts in this directory, (such as ./basic).
\r
238 > +Have a look at "basic" for an example.
\r
240 > +add_email_corpus takes arguments "--small" and "--medium" for when you
\r
241 > +want smaller corpuses to check.
\r
246 > +time_done does the cleanup; comment it out or define "$debug" to leave
\r
247 > +the temporary files around.
\r
249 > +Currently there is no option processing (e.g. --debug) in the
\r
250 > +performance tests.
\r
251 > diff --git a/performance-test/basic b/performance-test/basic
\r
252 > new file mode 100755
\r
253 > index 0000000..9d015ee
\r
255 > +++ b/performance-test/basic
\r
259 > +. ./perf-test-lib.sh
\r
261 > +add_email_corpus
\r
265 > +time_run 'initial notmuch new' 'notmuch new'
\r
266 > +time_run 'second notmuch new' 'notmuch new'
\r
267 > +time_run 'dump *' 'notmuch dump > tags.out'
\r
268 > +time_run 'restore *' 'notmuch restore < tags.out'
\r
269 > +time_run 'tag * +new_tag' "notmuch tag +new_tag '*'"
\r
272 > diff --git a/performance-test/download/.gitignore b/performance-test/download/.gitignore
\r
273 > new file mode 100644
\r
274 > index 0000000..7b09234
\r
276 > +++ b/performance-test/download/.gitignore
\r
280 > diff --git a/performance-test/download/notmuch-email-corpus-0.2.tar.xz.asc b/performance-test/download/notmuch-email-corpus-0.2.tar.xz.asc
\r
281 > new file mode 100644
\r
282 > index 0000000..c8b4b3d
\r
284 > +++ b/performance-test/download/notmuch-email-corpus-0.2.tar.xz.asc
\r
286 > +-----BEGIN PGP SIGNATURE-----
\r
287 > +Version: GnuPG v1.4.12 (GNU/Linux)
\r
289 > +iJwEAAECAAYFAlCsvx0ACgkQTiiN/0Um85kZAwP9GgOQ22jK8mr5X4pT/mB8EjSH
\r
290 > +QbndlxxbRrP0ChTqjBQoD3IsTHjNL7W572BfXb/MNo94R/iIQ7yTHCDVNuwBhvKd
\r
291 > +7qgIuW2FUS1uTfJRP5KBNf8JPuin+6wqGe8/+y/iOs+XJSdiYg1ElS49Ntnpg0yl
\r
292 > +btImgEcxTxQ2qfzDS1g=
\r
294 > +-----END PGP SIGNATURE-----
\r
295 > diff --git a/performance-test/notmuch-perf-test b/performance-test/notmuch-perf-test
\r
296 > new file mode 100755
\r
297 > index 0000000..1bea345
\r
299 > +++ b/performance-test/notmuch-perf-test
\r
301 > +#!/usr/bin/env bash
\r
305 > +# Copyright (c) 2005 Junio C Hamano
\r
307 > +# Adapted from a Makefile to a shell script by Carl Worth (2010)
\r
309 > +if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
\r
310 > + echo "Error: The notmuch test suite requires a bash version >= 4.0"
\r
311 > + echo "due to use of associative arrays within the test suite."
\r
312 > + echo "Please try again with a newer bash (or help us fix the"
\r
313 > + echo "test suite to be more portable). Thanks."
\r
317 > +cd $(dirname "$0")
\r
323 > +for test in $TESTS; do
\r
326 > diff --git a/performance-test/perf-test-lib.sh b/performance-test/perf-test-lib.sh
\r
327 > new file mode 100644
\r
328 > index 0000000..11ccc77
\r
330 > +++ b/performance-test/perf-test-lib.sh
\r
334 > +. ../test/test-lib-common.sh
\r
338 > +if ! test -x ../notmuch
\r
340 > + echo >&2 'You do not seem to have built notmuch yet.'
\r
344 > +add_email_corpus ()
\r
346 > + rm -rf ${MAIL_DIR}
\r
351 > + arg="/enron/bailey-s"
\r
354 > + arg="/notmuch-archive"
\r
358 > + if command -v pixz > /dev/null; then
\r
364 > + printf "Unpacking corpus\n"
\r
365 > + tar --checkpoint=.5000 --extract --strip-components=1 \
\r
366 > + --directory ${TMP_DIRECTORY} \
\r
367 > + --use-compress-program ${XZ} \
\r
368 > + --file ../download/notmuch-email-corpus-${PERFTEST_VERSION}.tar.xz \
\r
369 > + notmuch-email-corpus/mail"$arg"
\r
371 I'm a bit confused by this. What happens if you don't specify --small
\r
372 or --medium? Is the "large"/default corpus just the combined small
\r
373 and medium corpora? Would be worth a comment, at least.
\r
375 This probably doesn't matter now, but I wonder if we want to unpack on
\r
376 first use to somewhere not test-specific and then cp -rl the corpus
\r
377 into the test directory. I haven't tried unpacking the corpus yet,
\r
378 but if you're running tests repeatedly to compare results, or running
\r
379 more than one performance test, it seems like a full decompress and
\r
380 unpack could get onerous.
\r
386 > +print_header () {
\r
387 > + printf " Wall(s)\tUsr(s)\tSys(s)\tRes(K)\tIn\tOut\n"
\r
389 Should the header include which corpus size is in use? This would be
\r
390 important when emailing around performance results.
\r
395 > + printf "%-22s" "$1"
\r
396 > + if test "$verbose" != "t"; then exec 4>test.output 3>&4; fi
\r
397 > + if ! eval >&3 "/usr/bin/time -f '%e\t%U\t%S\t%M\t%I\t%O' $2" ; then
\r
398 > + test_failure=$(($test_failure + 1))
\r
403 > + if [ "$test_failure" = "0" ]; then
\r
404 > + rm -rf "$remove_tmp"
\r
411 > +cd -P "$test" || error "Cannot setup test environment"
\r
413 > diff --git a/performance-test/version.sh b/performance-test/version.sh
\r
414 > new file mode 100644
\r
415 > index 0000000..d9270b1
\r
417 > +++ b/performance-test/version.sh
\r
419 > +# this should be both a valid Makefile fragment and valid POSIX(ish) shell.
\r
421 > +PERFTEST_VERSION=0.2
\r