How does notmuch track mails?
[notmuch-archives.git] / 79 / b68e99a8683de7170a8a014d08c7ec99611698
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 E810C431FBC\r
6         for <notmuch@notmuchmail.org>; Thu, 14 Jan 2010 15:16:26 -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: -2.198\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.198 tagged_above=-999 required=5\r
12         tests=[ALL_TRUSTED=-1.8, AWL=0.342, BAYES_20=-0.74] autolearn=ham\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 zilSrVTyYztG; Thu, 14 Jan 2010 15:16:25 -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 C5D62431FAE;\r
18         Thu, 14 Jan 2010 15:16:25 -0800 (PST)\r
19 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
20         id 2241C550090; Thu, 14 Jan 2010 15:16:25 -0800 (PST)\r
21 From: Carl Worth <cworth@cworth.org>\r
22 To: Oliver Charles <oliver.g.charles@googlemail.com>, notmuch@notmuchmail.org\r
23 In-Reply-To: <5641883d1001140730l22832715ld6bdc95c9938d314@mail.gmail.com>\r
24 References: <5641883d1001140730l22832715ld6bdc95c9938d314@mail.gmail.com>\r
25 Date: Thu, 14 Jan 2010 15:16:24 -0800\r
26 Message-ID: <87d41ce0qf.fsf@yoom.home.cworth.org>\r
27 MIME-Version: 1.0\r
28 Content-Type: multipart/signed; boundary="=-=-=";\r
29         micalg=pgp-sha1; protocol="application/pgp-signature"\r
30 Subject: Re: [notmuch] Notmuch performance problems on OSX\r
31 X-BeenThere: notmuch@notmuchmail.org\r
32 X-Mailman-Version: 2.1.13\r
33 Precedence: list\r
34 List-Id: "Use and development of the notmuch mail system."\r
35         <notmuch.notmuchmail.org>\r
36 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
37         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
38 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
39 List-Post: <mailto:notmuch@notmuchmail.org>\r
40 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
41 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
43 X-List-Received-Date: Thu, 14 Jan 2010 23:16:27 -0000\r
44 \r
45 --=-=-=\r
46 Content-Transfer-Encoding: quoted-printable\r
47 \r
48 Hi Oliver, welcome to notmuch!\r
49 \r
50 On Thu, 14 Jan 2010 15:30:48 +0000, Oliver Charles <oliver.g.charles@google=\r
51 mail.com> wrote:\r
52 > I've installed the latest notmuch from Git at this time of writing,\r
53 > along with Xapian from SVN head. However, just tagging a single thread\r
54 > with only one message seems to take too long:\r
55 >=20\r
56 > $ time notmuch tag +dissertation thread:7dc536441e6deade4256a46d46451221\r
57 >=20\r
58 > real  0m0.812s\r
59 > user  0m0.022s\r
60 > sys   0m0.037s\r
61 \r
62 Things work quite a bit faster than that on my machine:\r
63 \r
64 $ time notmuch tag +foo id:5641883d1001140730l22832715ld6bdc95c9938d314@mai=\r
65 l.gmail.com\r
66 \r
67 real    0m0.024s\r
68 user    0m0.012s\r
69 sys     0m0.004s\r
70 \r
71 But that could just be system differences.\r
72 \r
73 > And tagging all my messages is really horrible:\r
74 >=20\r
75 > $ time notmuch tag +foobar tag:inbox\r
76 >=20\r
77 > real  0m5.076s\r
78 > user  0m3.688s\r
79 > sys   0m0.105s\r
80 \r
81 For this operation, I can't really compare. How many messages are you\r
82 tagging? Here's that operation for me with 525 messages in my inbox:\r
83 \r
84 $ time notmuch tag +foobar tag:inbox\r
85 \r
86 real    0m1.551s\r
87 user    0m1.504s\r
88 sys     0m0.016s\r
89 \r
90 > That xapian-svn was built from svn HEAD right now, so I'm assuming it\r
91 > contains the #250 fix (http://trac.xapian.org/changeset/13808)\r
92 \r
93 Which I think means that things could have been even *much* slower\r
94 before. ;-)\r
95 \r
96 The Xapian defect #250 was just one, initial (and obvious) performance\r
97 problem. [Though, as I mentioned in a previous thread, if you're using a\r
98 Xapian flint database, (look for .notmuch/xapian/iamflint), then you\r
99 won't get the benefit of the Xapian fix until you rebuild your notmuch\r
100 database from scratch with a current notmuch.]\r
101 \r
102 Once you've verified that you've got the #250 fix functional, there\r
103 could still be lots of performance bugs. And it would be time to start\r
104 profiling.\r
105 \r
106 Perhaps the "notmuch daemon" idea (which we've proposed earlier for\r
107 other reasons) could help reduce overhead from reading the database and\r
108 writing it back out again. So that might be one avenue to explore for\r
109 fixing things.\r
110 \r
111 I have no idea what OS X does, but Linux keeps my notmuch database in\r
112 its buffer cache so I can do these operations without even touching\r
113 "disk" (which is actually an SSD anyway, which also helps). I just\r
114 tried, and was able to get the single-message tag operation to be 3\r
115 times slower by dropping the cache:\r
116 \r
117 $ sudo sh -c "echo 3 > /proc/sys/vm/drop_caches "\r
118 $ time notmuch tag +foo id:5641883d1001140730l22832715ld6bdc95c9938d314@mai=\r
119 l.gmail.com\r
120 \r
121 real    0m0.062s\r
122 user    0m0.000s\r
123 sys     0m0.020s\r
124 \r
125 But again, whatever the performance problem might be, the first step\r
126 would be to examine some profiles. (And I'm clueless, myself as to what\r
127 profiling tools might be available for OS X.)\r
128 \r
129 =2DCarl\r
130 \r
131 --=-=-=\r
132 Content-Type: application/pgp-signature\r
133 \r
134 -----BEGIN PGP SIGNATURE-----\r
135 Version: GnuPG v1.4.10 (GNU/Linux)\r
136 \r
137 iD8DBQFLT6XI6JDdNq8qSWgRAvqAAJ9YBzxsYXYrJ6qcg52b+Loik5Up+ACfbgjd\r
138 G7XrYeT28dru4gDwi5DP6eU=\r
139 =Rico\r
140 -----END PGP SIGNATURE-----\r
141 --=-=-=--\r