[PATCH 2/2] contrib/nmbug: add nmbug-status script
[notmuch-archives.git] / 81 / 205f62a4af779a1e3d7a272a961a186b7262de
1 Return-Path: <jason@jasonwoof.com>\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 357BE431FD0\r
6         for <notmuch@notmuchmail.org>; Tue, 12 Jul 2011 13:10:09 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 mC1Zd2qgNlf6 for <notmuch@notmuchmail.org>;\r
16         Tue, 12 Jul 2011 13:10:08 -0700 (PDT)\r
17 Received: from mail-vw0-f53.google.com (mail-vw0-f53.google.com\r
18         [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id B11BC431FB6\r
21         for <notmuch@notmuchmail.org>; Tue, 12 Jul 2011 13:10:08 -0700 (PDT)\r
22 Received: by vws13 with SMTP id 13so4139244vws.26\r
23         for <notmuch@notmuchmail.org>; Tue, 12 Jul 2011 13:10:08 -0700 (PDT)\r
24 Received: by 10.220.7.79 with SMTP id c15mr119732vcc.3.1310501407819;\r
25         Tue, 12 Jul 2011 13:10:07 -0700 (PDT)\r
26 Received: from compy.jasonwoof.org (c-98-216-100-90.hsd1.ma.comcast.net\r
27         [98.216.100.90])\r
28         by mx.google.com with ESMTPS id bd5sm2384994vcb.11.2011.07.12.13.10.05\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Tue, 12 Jul 2011 13:10:05 -0700 (PDT)\r
31 Date: Tue, 12 Jul 2011 16:10:02 -0400\r
32 From: Jason Woofenden <jason@jasonwoof.com>\r
33 To: Notmuch Mail <notmuch@notmuchmail.org>\r
34 Subject: Re: Slowness (search opens every email file?)\r
35 Message-ID: <20110712201002.GA15019@compy.jasonwoof.org>\r
36 Mail-Followup-To: Notmuch Mail <notmuch@notmuchmail.org>\r
37 References: <20110711190721.GA5386@compy.jasonwoof.org>\r
38         <20110711215858.GA18884@brick.lan>\r
39 MIME-Version: 1.0\r
40 Content-Type: text/plain; charset=us-ascii\r
41 Content-Disposition: inline\r
42 In-Reply-To: <20110711215858.GA18884@brick.lan>\r
43 User-Agent: Mutt/1.5.21 (2010-09-15)\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Tue, 12 Jul 2011 20:10:10 -0000\r
57 \r
58 On 2011-07-11 10:58PM, Patrick Totzke wrote:\r
59 > Hi Jason,\r
60 > On Mon, Jul 11, 2011 at 03:07:21PM -0400, Jason Woofenden wrote:\r
61 > > notmuch search tag:foo is slow!\r
62 > > \r
63 > yes, i've just used the vim ui for the first time and i agreee, its sluggish,\r
64 > searching for * takes a while.\r
65 \r
66 It's not the vim ui that's the bottleneck. The underlying notmuch\r
67 search command is slow. I gave examples in my last e-mail:\r
68 \r
69 >> notmuch search tag:foo  took  0.5 seconds for 32 threads\r
70 >> \r
71 >> notmuch search foo took 6.4 seconds for 130 threads\r
72 \r
73 \r
74 > > (when my e-mail files are not already in the disk cache)\r
75 > > \r
76 > > I saw on my activity monitor applet that it was using mostly i/o,\r
77 > > and started to wonder if it was opening every e-mail. I little work\r
78 > > with strace and searching revealed that this command was opening\r
79 > > many many e-mail files from my maildir(s). I spent a little while\r
80 > > digging around in the notmuch source, and didn't see where it was\r
81 > > opening the email files.\r
82\r
83 > I cannot reproduce this. I'm no expert, but at least the output of \r
84 >  strace vim -c ":NotMuch" 2>log\r
85 \r
86 :NotMuch just shows the mailboxes. that's fast. It's showing the\r
87 contents that is slow. And it's not vim, it's because the notmuch\r
88 command is slow. Try this in a terminal:\r
89 \r
90 strace notmuch search tag:flagged 2>&1 | grep 'open(.*/cur/'\r
91 \r
92 Of course change the tag if you don't have flagged messages.\r
93 \r
94 \r
95 > A quick browse through notmuch.vim tells me that \r
96 > 1) it doesn't use notmuchs json output, i think it should, as iirc\r
97 > this api is considered 'more stable' and is easier to parse than the \r
98 > default output. More importantly,\r
99 \r
100 I like this idea. I did some work earlier on improving the message\r
101 parsing in the vim ui. Might be better to use the json. I'll look\r
102 into json parsing in vim.\r
103 \r
104 \r
105 > 2) the output of notmuch is copied into a list. This will of course\r
106 > be slow if your query matches a lot of messages. Could this be done\r
107 > by asyncronously writing to the buffer somehow?\r
108 \r
109 I'm pretty sure vim doesn't do asynchronous anything. That came up\r
110 in a vim vs emacs article I read.\r
111 \r
112 \r
113 Take care,   - Jason\r