1 Return-Path: <bremner@tethera.net>
\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 B3421431FBD
\r
6 for <notmuch@notmuchmail.org>; Mon, 24 Dec 2012 06:59:37 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 zzTlHU3ij6Zw for <notmuch@notmuchmail.org>;
\r
16 Mon, 24 Dec 2012 06:59:36 -0800 (PST)
\r
17 Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])
\r
18 (using TLSv1 with cipher AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id A2D66431FAF
\r
21 for <notmuch@notmuchmail.org>; Mon, 24 Dec 2012 06:59:36 -0800 (PST)
\r
22 Received: from fctnnbsc30w-156034082078.dhcp-dynamic.fibreop.nb.bellaliant.net
\r
23 ([156.34.82.78] helo=zancas.localnet)
\r
24 by tesseract.cs.unb.ca with esmtpsa
\r
25 (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72)
\r
26 (envelope-from <bremner@tethera.net>) id 1Tn9V9-0000TR-7K
\r
27 for notmuch@notmuchmail.org; Mon, 24 Dec 2012 10:59:35 -0400
\r
28 Received: from bremner by zancas.localnet with local (Exim 4.80)
\r
29 (envelope-from <bremner@tethera.net>) id 1Tn9V3-0001kR-GO
\r
30 for notmuch@notmuchmail.org; Mon, 24 Dec 2012 10:59:29 -0400
\r
31 From: david@tethera.net
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: v2 of valgrind based memory tests
\r
34 Date: Mon, 24 Dec 2012 10:59:16 -0400
\r
35 Message-Id: <1356361160-6449-1-git-send-email-david@tethera.net>
\r
36 X-Mailer: git-send-email 1.7.10.4
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.13
\r
41 List-Id: "Use and development of the notmuch mail system."
\r
42 <notmuch.notmuchmail.org>
\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
46 List-Post: <mailto:notmuch@notmuchmail.org>
\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
50 X-List-Received-Date: Mon, 24 Dec 2012 14:59:38 -0000
\r
54 id:1355196820-29734-1-git-send-email-david@tethera.net
\r
56 I tried to follow the suggestions of
\r
58 id:20121216191121.GH6187@mit.edu
\r
62 diff --git a/performance-test/M00-new b/performance-test/M00-new
\r
63 index 733e9b0..99c3f52 100755
\r
64 --- a/performance-test/M00-new
\r
65 +++ b/performance-test/M00-new
\r
66 @@ -9,6 +9,7 @@ uncache_database
\r
70 +# run 'notmuch new' a second time, to test different code paths
\r
71 memory_run "notmuch new" "notmuch new"
\r
74 diff --git a/performance-test/Makefile.local b/performance-test/Makefile.local
\r
75 index 357d800..73aa963 100644
\r
76 --- a/performance-test/Makefile.local
\r
77 +++ b/performance-test/Makefile.local
\r
78 @@ -4,7 +4,6 @@ dir := performance-test
\r
80 include $(dir)/version.sh
\r
82 -# these two are just make sure dir is expanded at the right time.
\r
83 TIME_TEST_SCRIPT := ${dir}/notmuch-time-test
\r
84 MEMORY_TEST_SCRIPT := ${dir}/notmuch-memory-test
\r
86 @@ -17,11 +16,11 @@ perf-test: time-test memory-test
\r
88 time-test: setup-perf-test all
\r
90 - $(TIME_TEST_SCRIPT) $(TEST_OPTIONS)
\r
91 + $(TIME_TEST_SCRIPT) $(OPTIONS)
\r
93 memory-test: setup-perf-test all
\r
95 - $(MEMORY_TEST_SCRIPT) $(TEST_OPTIONS)
\r
96 + $(MEMORY_TEST_SCRIPT) $(OPTIONS)
\r
99 .PHONY: download-corpus setup-perf-test
\r
100 diff --git a/performance-test/README b/performance-test/README
\r
101 index 7eaf5f7..996724c 100644
\r
102 --- a/performance-test/README
\r
103 +++ b/performance-test/README
\r
108 -This directory contains two kinds of performance tests, time tests,
\r
109 +This directory contains two kinds of performance tests: time tests,
\r
110 and memory tests. The former use gnu time, and the latter use
\r
113 @@ -12,7 +12,7 @@ In addition to having notmuch, you need:
\r
117 -- gnu time (for the time tests).
\r
118 +- gnu time (for the time tests)
\r
119 - xz. Some speedup can be gotten by installing "pixz", but this is
\r
120 probably only worthwhile if you are debugging the tests.
\r
121 - valgrind (for the memory tests)
\r
122 @@ -59,13 +59,13 @@ supports the following arguments
\r
123 temporary directories.
\r
125 When using the make targets, you can pass arguments to all test
\r
126 -scripts by defining the make variable TEST_OPTIONS.
\r
127 +scripts by defining the make variable OPTIONS.
\r
132 -Have a look at "T01-dump-restore" for an example time test and and
\r
133 -"M00-new" for an example memory tests. In both cases sourcing
\r
134 +Have a look at "T01-dump-restore" for an example time test and
\r
135 +"M00-new" for an example memory test. In both cases sourcing
\r
136 "perf-test-lib.sh" is mandatory.
\r
139 diff --git a/performance-test/perf-test-lib.sh b/performance-test/perf-test-lib.sh
\r
140 index 79eb2c5..10d05e0 100644
\r
141 --- a/performance-test/perf-test-lib.sh
\r
142 +++ b/performance-test/perf-test-lib.sh
\r
143 @@ -89,11 +89,10 @@ add_email_corpus ()
\r
145 cp -lr $TAG_CORPUS $TMP_DIRECTORY/corpus.tags
\r
146 cp -lr $MAIL_CORPUS $MAIL_DIR
\r
150 -notmuch_new_with_cache () {
\r
152 +notmuch_new_with_cache ()
\r
154 if [ -d $DB_CACHE_DIR ]; then
\r
155 cp -r $DB_CACHE_DIR ${MAIL_DIR}/.notmuch
\r
157 @@ -102,8 +101,8 @@ notmuch_new_with_cache () {
\r
168 @@ -111,17 +110,19 @@ time_start () {
\r
169 notmuch_new_with_cache time_run
\r
178 - _timestamp=$(printf "%x" $(date +"%s"))
\r
179 - log_dir=$(mktemp -d "${TEST_DIRECTORY}/log.$(basename $0)-$corpus_size-${_timestamp}-XXXXXX")
\r
180 + local timestamp=$(date +%Y%m%dT%H%M%S)
\r
181 + log_dir="${TEST_DIRECTORY}/log.$(basename $0)-$corpus_size-${timestamp}"
\r
182 + mkdir -p ${log_dir}
\r
184 notmuch_new_with_cache memory_run
\r
190 test_count=$(($test_count+1))
\r
192 log_file=$log_dir/$test_count.log
\r
193 @@ -134,11 +135,13 @@ memory_run () {
\r
203 -cache_database () {
\r
206 if [ -d $MAIL_DIR/.notmuch ]; then
\r
207 cp -r $MAIL_DIR/.notmuch $DB_CACHE_DIR
\r
209 @@ -146,16 +149,18 @@ cache_database () {
\r
213 -uncache_database () {
\r
214 +uncache_database ()
\r
216 rm -rf $DB_CACHE_DIR
\r
222 printf "\t\t\tWall(s)\tUsr(s)\tSys(s)\tRes(K)\tIn/Out(512B)\n"
\r
229 printf " %-22s" "$1"
\r
230 test_count=$(($test_count+1))
\r
231 if test "$verbose" != "t"; then exec 4>test.output 3>&4; fi
\r
232 @@ -166,7 +171,8 @@ time_run () {
\r
239 if [ "$test_failure" = "0" ]; then
\r
240 rm -rf "$remove_tmp"
\r