From: Austin Clements Date: Wed, 5 Dec 2012 05:02:55 +0000 (+1900) Subject: Re: [PATCH 3/3] perf-test: add caching of xapian database. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=b769110fb235f96e3a6c4e93e790b757c460bfba;p=notmuch-archives.git Re: [PATCH 3/3] perf-test: add caching of xapian database. --- diff --git a/fb/825fa6c406782e35fd339697cac13f0d2c8d31 b/fb/825fa6c406782e35fd339697cac13f0d2c8d31 new file mode 100644 index 000000000..7d2dacb16 --- /dev/null +++ b/fb/825fa6c406782e35fd339697cac13f0d2c8d31 @@ -0,0 +1,185 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id A097A431FAE + for ; Tue, 4 Dec 2012 21:03:04 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id xjEoeRQIty46 for ; + Tue, 4 Dec 2012 21:03:00 -0800 (PST) +Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU + [18.9.25.14]) + by olra.theworths.org (Postfix) with ESMTP id 0BB0F431FB6 + for ; Tue, 4 Dec 2012 21:02:59 -0800 (PST) +X-AuditID: 1209190e-b7f516d0000008e4-98-50bed582bbeb +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP + id 4E.08.02276.285DEB05; Wed, 5 Dec 2012 00:02:58 -0500 (EST) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id qB552v5C011663; + Wed, 5 Dec 2012 00:02:58 -0500 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qB552tIU020186 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); + Wed, 5 Dec 2012 00:02:57 -0500 (EST) +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) + (envelope-from ) + id 1Tg78J-0004ih-Mq; Wed, 05 Dec 2012 00:02:55 -0500 +From: Austin Clements +To: david@tethera.net, notmuch@notmuchmail.org +Subject: Re: [PATCH 3/3] perf-test: add caching of xapian database. +In-Reply-To: <1354583824-10520-3-git-send-email-david@tethera.net> +References: <1354583824-10520-1-git-send-email-david@tethera.net> + <1354583824-10520-3-git-send-email-david@tethera.net> +User-Agent: Notmuch/0.14+100~gcb9b0b0 (http://notmuchmail.org) Emacs/23.4.1 + (i486-pc-linux-gnu) +Date: Wed, 05 Dec 2012 00:02:55 -0500 +Message-ID: <87sj7lccqo.fsf@awakening.csail.mit.edu> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFmpkleLIzCtJLcpLzFFi42IRYrdT0W26ui/A4FCTjcXGZT+ZLW60djNa + XL85k9mB2eNX21xmj2erbjF7bDn0njmAOYrLJiU1J7MstUjfLoEro+PwNuaCe9IVj1cuY2lg + nCnWxcjJISFgIvH/xElWCFtM4sK99WxdjFwcQgL7GCUmftvDAuGsZ5T4M+UtM4RzgUni9tQ/ + 7BDOEkaJ219aGEH62QT0JVasnQQ0i4NDREBPYuFWGZAws4CaxKQ1Z9hBbGEBZ4mnpxrZQUo4 + BZwkFjTUgoSFBMoldnb+YQEJiwrES1xeqgASZhFQlbg3rYMNxOYFOnTjhu3MELagxMmZT1gg + pmtJ3Pj3kmkCo+AsJKlZSFILGJlWMcqm5Fbp5iZm5hSnJusWJyfm5aUW6Rrr5WaW6KWmlG5i + BIUupyTfDsavB5UOMQpwMCrx8Eoa7wsQYk0sK67MPcQoycGkJMrbdgQoxJeUn1KZkVicEV9U + mpNafIhRgoNZSYT3nx1QjjclsbIqtSgfJiXNwaIkznsl5aa/kEB6YklqdmpqQWoRTFaGg0NJ + gvfWFaBGwaLU9NSKtMycEoQ0EwcnyHAeoOGKV0GGFxck5hZnpkPkTzHqcvT+63rCKMSSl5+X + KiXO+x9kkABIUUZpHtwcWMp5xSgO9JYwLyfIKB5guoKb9ApoCRPQkhdCu0GWlCQipKQaGH1t + ZpQ+ERf4XLYtjW/i2p2KT6NrA7P19vTu+XKTRdlM7slq8ZmmLefs7gkcS3hhufuJlp2+zUuG + 9reHS43FdvRkSjWe8ZCbpvOodOf81XaBnQ8aq5drPr1q8+Wqqdnx94E83Zkv416st3Cw5JnZ + HnbSftH2oAOTWqfGulk+jr1xZraq1qln8UosxRmJhlrMRcWJAPmOwFsUAwAA +Cc: David Bremner +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 05 Dec 2012 05:03:04 -0000 + +This seems like an odd way to do this. Timing the initial notmuch new +seems like the goal of exactly one performance test and irrelevant to +the others. What about splitting "basic" into two tests: an explicit +notmuch new performance test and a separate test that does +dump/restore/tag. The second test can always use a cached notmuch +database (creating it if necessary). If you want to be really kind, the +notmuch new performance test could save its result as the database cache +if there isn't a database cache; then people don't have to build the +database twice if they (or notmuch-perf-test) run the tests in the right +order. + +On Mon, 03 Dec 2012, david@tethera.net wrote: +> From: David Bremner +> +> The caching and uncaching seem to be necessarily manual, as timing the +> initial notmuch new is one of our goals with this suite. +> --- +> performance-test/.gitignore | 1 + +> performance-test/Makefile.local | 2 +- +> performance-test/basic | 5 +++++ +> performance-test/perf-test-lib.sh | 18 ++++++++++++++++++ +> 4 files changed, 25 insertions(+), 1 deletion(-) +> +> diff --git a/performance-test/.gitignore b/performance-test/.gitignore +> index 7e20f7c..779a115 100644 +> --- a/performance-test/.gitignore +> +++ b/performance-test/.gitignore +> @@ -1,2 +1,3 @@ +> tmp.*/ +> corpus.mail.*/ +> +notmuch.cache.*/ +> diff --git a/performance-test/Makefile.local b/performance-test/Makefile.local +> index eb713d0..b136a88 100644 +> --- a/performance-test/Makefile.local +> +++ b/performance-test/Makefile.local +> @@ -29,4 +29,4 @@ $(TXZFILE): +> download-corpus: +> wget -O ${TXZFILE} ${DEFAULT_URL} +> +> -CLEAN := $(CLEAN) $(dir)/tmp.* $(dir)/corpus.mail.* +> +CLEAN := $(CLEAN) $(dir)/tmp.* $(dir)/corpus.mail.* $(dir)/notmuch.cache.* +> diff --git a/performance-test/basic b/performance-test/basic +> index 9d015ee..41a7ff1 100755 +> --- a/performance-test/basic +> +++ b/performance-test/basic +> @@ -2,11 +2,16 @@ +> +> . ./perf-test-lib.sh +> +> +uncache_database +> + +> add_email_corpus +> +> print_header +> +> time_run 'initial notmuch new' 'notmuch new' +> + +> +cache_database +> + +> time_run 'second notmuch new' 'notmuch new' +> time_run 'dump *' 'notmuch dump > tags.out' +> time_run 'restore *' 'notmuch restore < tags.out' +> diff --git a/performance-test/perf-test-lib.sh b/performance-test/perf-test-lib.sh +> index 9fbf874..c9b131a 100644 +> --- a/performance-test/perf-test-lib.sh +> +++ b/performance-test/perf-test-lib.sh +> @@ -36,6 +36,8 @@ then +> fi +> +> CORPUS_DIR=${TEST_DIRECTORY}/corpus.mail.$corpus_size +> +DB_CACHE_DIR=${TEST_DIRECTORY}/notmuch.cache.$corpus_size +> + +> add_email_corpus () +> { +> rm -rf ${MAIL_DIR} +> @@ -69,9 +71,25 @@ add_email_corpus () +> printf "\n" +> +> fi +> + +> cp -lr $CORPUS_DIR $MAIL_DIR +> + +> + if [ -d $DB_CACHE_DIR ]; then +> + cp -r $DB_CACHE_DIR ${MAIL_DIR}/.notmuch +> + fi +> } +> +> +cache_database () { +> + if [ -d $MAIL_DIR/.notmuch ]; then +> + cp -r $MAIL_DIR/.notmuch $DB_CACHE_DIR +> + else +> + echo "Warning: No database found to cache" +> + fi +> +} +> + +> +uncache_database () { +> + rm -rf $DB_CACHE_DIR +> +} +> +> print_header () { +> printf "[v%4s] Wall(s)\tUsr(s)\tSys(s)\tRes(K)\tIn(512B)\tOut(512B)\n" \ +> -- +> 1.7.10.4 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch