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 56EE2431FB5
\r
6 for <notmuch@notmuchmail.org>; Wed, 8 Dec 2010 13:58:48 -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
12 autolearn=unavailable
\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 vWHQiZBRt-e7 for <notmuch@notmuchmail.org>;
\r
16 Wed, 8 Dec 2010 13:58:48 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 29DFF431FB6
\r
20 for <notmuch@notmuchmail.org>; Wed, 8 Dec 2010 13:58:48 -0800 (PST)
\r
21 X-AuditID: 12074423-b7bd0ae000000a00-92-4cffff970d62
\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])
\r
23 by dmz-mailsec-scanner-6.mit.edu (Symantec Brightmail Gateway) with
\r
24 SMTP id 92.47.02560.79FFFFC4; Wed, 8 Dec 2010 16:58:47 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id oB8Lwk2e000460;
\r
27 Wed, 8 Dec 2010 16:58:46 -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 oB8LwieZ018638
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Wed, 8 Dec 2010 16:58:45 -0500 (EST)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.72)
\r
35 (envelope-from <amdragon@mit.edu>)
\r
36 id 1PQS28-0001fb-D8; Wed, 08 Dec 2010 16:58:44 -0500
\r
37 Date: Wed, 8 Dec 2010 16:58:44 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: Carl Worth <cworth@cworth.org>
\r
40 Subject: Re: [PATCH 3/4] Optimize thread search using matched docid sets.
\r
41 Message-ID: <20101208215844.GS2447@mit.edu>
\r
42 References: <20101117192826.GU2439@mit.edu>
\r
43 <874oap5aek.fsf@yoom.home.cworth.org>
\r
45 Content-Type: text/plain; charset=us-ascii
\r
46 Content-Disposition: inline
\r
47 In-Reply-To: <874oap5aek.fsf@yoom.home.cworth.org>
\r
48 User-Agent: Mutt/1.5.20 (2009-06-14)
\r
49 X-Brightmail-Tracker: AAAAAA==
\r
50 Cc: notmuch@notmuchmail.org
\r
51 X-BeenThere: notmuch@notmuchmail.org
\r
52 X-Mailman-Version: 2.1.13
\r
54 List-Id: "Use and development of the notmuch mail system."
\r
55 <notmuch.notmuchmail.org>
\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
59 List-Post: <mailto:notmuch@notmuchmail.org>
\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
63 X-List-Received-Date: Wed, 08 Dec 2010 21:58:48 -0000
\r
65 Quoth Carl Worth on Dec 07 at 5:19 pm:
\r
66 > On Wed, 17 Nov 2010 14:28:26 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
\r
67 > > This reduces thread search's 1+2t Xapian queries (where t is the
\r
68 > > number of matched threads) to 1+t queries and constructs exactly one
\r
69 > > notmuch_message_t for each message instead of 2 to 3.
\r
71 > Fantastic stuff, Austin!
\r
73 > I've merged this now, (sorry it took me a while to get to it).
\r
75 > One of the reasons I didn't merge it immediately is that I wanted to
\r
76 > ensure that I understood the original author-ordering bug. Basically,
\r
77 > I'm inherently uncomfortable with a performance optimization that fixes
\r
78 > a bug as a side effect, (unless we understand that very well).
\r
80 > So what I pushed actually adds the bug fix first, so that the
\r
81 > performance optimization makes no change at all to the test suite. That
\r
82 > feels better to me, (even though it simply demonstrated conclusively
\r
83 > that the bug was in a piece of code that was eliminated by the
\r
86 Ah, good. You are less lazy than I.
\r
88 > Anyway, in a quick reading of the code, the only little thing I saw was:
\r
90 > > + size_t count = (bound + sizeof (doc_ids->bitmap[0]) - 1) /
\r
91 > > + sizeof (doc_ids->bitmap[0]);
\r
93 > Which would look better to my eyes with a 1 factored out of the
\r
96 > size_t count = 1 + (bound - 1) / sizeof (doc_ids->bitmap[0]);
\r
98 > And the repeated use of "sizeof (doc_ids->bitmap[0])" could maybe do
\r
99 > with a macro for better legibility. Though it would be an evil macro if
\r
100 > it didn't accept an argument, and it wouldn't be much shorter if it
\r
101 > did. So maybe it's fine as-is.
\r
103 I found what I think is a cleaner way to write that bit of code. A
\r
104 small patch is forthcoming.
\r
106 > Thanks for the optimization. Now all we need is a little notmuch
\r
107 > benchmark so that I can be sure not to regress any performance work with
\r
108 > my sloppy coding!
\r
110 Now that this is in (and I have a temporary respite from TA duties),
\r
111 I'm going to finish up and send out my other ~1.7X improvement, just
\r
112 to get it out of my queue. Then I'll look at making a performance
\r
113 regression suite. Were you thinking of some standard set of timed
\r
114 operations wrapped in a little script that can tell you if you've made
\r
115 things worse, or something more elaborate?
\r
117 Thanks for pushing these patches!
\r