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 67358431FD0 for ; Mon, 11 Jul 2011 14:59:06 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 uzodx91vpLXP for ; Mon, 11 Jul 2011 14:59:05 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 45EB9431FB6 for ; Mon, 11 Jul 2011 14:59:05 -0700 (PDT) Received: by wyh22 with SMTP id 22so3246825wyh.26 for ; Mon, 11 Jul 2011 14:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=TBu5anTZ281vVZYZ7L6WbhuPO7dXP2BaSf5eE/0xBH4=; b=VPrdNOIRwSioQiCZNIJuO86WxJPxizUWfNr/TC61/MMsLzsck5t169qDMqL+20LHab ECFbVICu5a+WtFojEvF2jUfHmvFwys7fy8d4HAq74RHt+8eRbmZcGHAi3N/y/uRSeLQ2 epsr3NO0pC1JcdnticBUanT8rijBJlDLO2UJI= Received: by 10.216.235.157 with SMTP id u29mr3352438weq.24.1310421543803; Mon, 11 Jul 2011 14:59:03 -0700 (PDT) Received: from brick.lan (cpc1-sgyl2-0-0-cust47.sgyl.cable.virginmedia.com [80.192.18.48]) by mx.google.com with ESMTPS id fe4sm10365228wbb.11.2011.07.11.14.59.00 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jul 2011 14:59:02 -0700 (PDT) Date: Mon, 11 Jul 2011 22:58:58 +0100 From: Patrick Totzke To: Jason Woofenden Subject: Re: Slowness (search opens every email file?) Message-ID: <20110711215858.GA18884@brick.lan> References: <20110711190721.GA5386@compy.jasonwoof.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline In-Reply-To: <20110711190721.GA5386@compy.jasonwoof.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Notmuch Mail 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: Mon, 11 Jul 2011 21:59:06 -0000 --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Jason, On Mon, Jul 11, 2011 at 03:07:21PM -0400, Jason Woofenden wrote: > notmuch search tag:foo is slow! >=20 yes, i've just used the vim ui for the first time and i agreee, its sluggis= h, searching for * takes a while. > (when my e-mail files are not already in the disk cache) >=20 > I saw on my activity monitor applet that it was using mostly i/o, > and started to wonder if it was opening every e-mail. I little work > with strace and searching revealed that this command was opening > many many e-mail files from my maildir(s). I spent a little while > digging around in the notmuch source, and didn't see where it was > opening the email files. I cannot reproduce this. I'm no expert, but at least the output of=20 strace vim -c ":NotMuch" 2>log does not contain any path that matches that of my maildir. Also, I wout be surprised if all individual mails would be read, because for this, a search for all messages feels too fast. > 2) Do you agree that it should instead get this information from > the database? agreed. And If the mail files get read on every search for you, something is definately going wrong there. A quick browse through notmuch.vim tells me that=20 1) it doesn't use notmuchs json output, i think it should, as iirc this api is considered 'more stable' and is easier to parse than the=20 default output. More importantly, 2) the output of notmuch is copied into a list. This will of course be slow if your query matches a lot of messages. Could this be done by asyncronously writing to the buffer somehow? best, /p --bg08WKrSYDhXBjb5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk4bciIACgkQlDQDZ9fWxaon3wCgvstp9RjrttNwVaoKWGu+4yvs YTQAn0byopDOt2qtL68Xmvr1OxC20FpY =glvO -----END PGP SIGNATURE----- --bg08WKrSYDhXBjb5--