Re: [PATCH 03/11] lib: give _thread_cleanup_author a more generic name
[notmuch-archives.git] / 26 / ae0f9350a0757017e5e79e7bb53db42e9c0f7d
1 Return-Path: <cworth@cworth.org>\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 AD2B9431FD0\r
6         for <notmuch@notmuchmail.org>; Tue,  7 Dec 2010 17:19:16 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.99\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.99 tagged_above=-999 required=5\r
12         tests=[ALL_TRUSTED=-1, T_MIME_NO_TEXT=0.01] 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 7RVfhmv7nC4S; Tue,  7 Dec 2010 17:19:15 -0800 (PST)\r
16 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
17         by olra.theworths.org (Postfix) with ESMTP id D5755431FB5;\r
18         Tue,  7 Dec 2010 17:19:15 -0800 (PST)\r
19 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
20         id 8505D2540E7; Tue,  7 Dec 2010 17:19:15 -0800 (PST)\r
21 From: Carl Worth <cworth@cworth.org>\r
22 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
23 Subject: Re: [PATCH 3/4] Optimize thread search using matched docid sets.\r
24 In-Reply-To: <20101117192826.GU2439@mit.edu>\r
25 References: <20101117192826.GU2439@mit.edu>\r
26 User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.2.1\r
27         (i486-pc-linux-gnu)\r
28 Date: Tue, 07 Dec 2010 17:19:15 -0800\r
29 Message-ID: <874oap5aek.fsf@yoom.home.cworth.org>\r
30 MIME-Version: 1.0\r
31 Content-Type: multipart/signed; boundary="=-=-=";\r
32         micalg=pgp-sha1; protocol="application/pgp-signature"\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.13\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Wed, 08 Dec 2010 01:19:16 -0000\r
46 \r
47 --=-=-=\r
48 Content-Transfer-Encoding: quoted-printable\r
49 \r
50 On Wed, 17 Nov 2010 14:28:26 -0500, Austin Clements <amdragon@MIT.EDU> wrot=\r
51 e:\r
52 > This reduces thread search's 1+2t Xapian queries (where t is the\r
53 > number of matched threads) to 1+t queries and constructs exactly one\r
54 > notmuch_message_t for each message instead of 2 to 3.\r
55 \r
56 Fantastic stuff, Austin!\r
57 \r
58 I've merged this now, (sorry it took me a while to get to it).\r
59 \r
60 One of the reasons I didn't merge it immediately is that I wanted to\r
61 ensure that I understood the original author-ordering bug. Basically,\r
62 I'm inherently uncomfortable with a performance optimization that fixes\r
63 a bug as a side effect, (unless we understand that very well).\r
64 \r
65 So what I pushed actually adds the bug fix first, so that the\r
66 performance optimization makes no change at all to the test suite. That\r
67 feels better to me, (even though it simply demonstrated conclusively\r
68 that the bug was in a piece of code that was eliminated by the\r
69 optimization).\r
70 \r
71 Anyway, in a quick reading of the code, the only little thing I saw was:\r
72 \r
73 > +    size_t count =3D (bound + sizeof (doc_ids->bitmap[0]) - 1) /\r
74 > +     sizeof (doc_ids->bitmap[0]);\r
75 \r
76 Which would look better to my eyes with a 1 factored out of the\r
77 division:\r
78 \r
79         size_t count =3D 1 + (bound - 1) / sizeof (doc_ids->bitmap[0]);\r
80 \r
81 And the repeated use of "sizeof (doc_ids->bitmap[0])" could maybe do\r
82 with a macro for better legibility. Though it would be an evil macro if\r
83 it didn't accept an argument, and it wouldn't be much shorter if it\r
84 did. So maybe it's fine as-is.\r
85 \r
86 Thanks for the optimization. Now all we need is a little notmuch\r
87 benchmark so that I can be sure not to regress any performance work with\r
88 my sloppy coding!\r
89 \r
90 =2DCarl\r
91 \r
92 =2D-=20\r
93 carl.d.worth@intel.com\r
94 \r
95 --=-=-=\r
96 Content-Type: application/pgp-signature\r
97 \r
98 -----BEGIN PGP SIGNATURE-----\r
99 Version: GnuPG v1.4.10 (GNU/Linux)\r
100 \r
101 iD8DBQFM/t0T6JDdNq8qSWgRAuU/AJ9pvhXKE4G8+0JEf0FVXYfxXnYs5QCfa+13\r
102 v6A7ICXrxwg6XGfHLL6M0Zo=\r
103 =Gwm5\r
104 -----END PGP SIGNATURE-----\r
105 --=-=-=--\r