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 2787A429E32 for ; Thu, 24 Oct 2013 01:57:33 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.299 X-Spam-Level: X-Spam-Status: No, score=-2.299 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3, UNPARSEABLE_RELAY=0.001] 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 mX8+bu46ORQ0 for ; Thu, 24 Oct 2013 01:57:26 -0700 (PDT) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id D5E2D429E29 for ; Thu, 24 Oct 2013 01:57:26 -0700 (PDT) Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r9O8vM74014478 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 Oct 2013 08:57:25 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9O8vKGS005409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Oct 2013 08:57:21 GMT Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9O8vJt6022939; Thu, 24 Oct 2013 08:57:19 GMT Received: from virt.cz.oracle.com (/10.163.102.127) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 24 Oct 2013 01:57:19 -0700 Date: Thu, 24 Oct 2013 10:57:15 +0200 From: Vladimir Marek To: Austin Clements Subject: Re: Re: Re: Possible addtions to notmuch new ? Message-ID: <20131024085715.GA17980@virt.cz.oracle.com> References: <20130812093443.GB16684@virt.cz.oracle.com> <20130812143426.GA13257@mit.edu> <20130829194114.GA133@virt.cz.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20130829194114.GA133@virt.cz.oracle.com> User-Agent: Mutt/1.5.21 (2012-12-30) X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Cc: notmuch@notmuchmail.org 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: Thu, 24 Oct 2013 08:57:33 -0000 Hi, > > > My mail setup is a directory containing several subdirectories each > > > subdirectory corresponds to one real mail account I am using. Each mail > > > account is synchronized differently - I am using offlineimap, fetchmeail > > > or even synthetically created emails (I am writing very simple jabber<-> > > > mail gate).Every now and then I am running 'notmuch new' to discover new > > > emails and make them available in my MUA. > > > > > > That works pretty well, but has some disadvantages too > > > - notmuch new takes very long time (30s) during which the notmuch > > > database seems to be locked for any other updates from my MUA > > > - notmuch new takes long time because it always processes my archive > > > dir containing many files. That's mostly un-necessary as typically > > > there's no new mail delivered > > > > Could you try this patch? It's basically untested other than passing > > the test suite, though in principle the worst harm it could do is make > > notmuch new miss new messages or think renames are deletions. If it > > helps significantly with your performance problems, I'll clean it up > > and add a test. > > > > diff --git a/notmuch-new.c b/notmuch-new.c > > index faa33f1..196c5cb 100644 > > --- a/notmuch-new.c > > +++ b/notmuch-new.c > > @@ -323,6 +323,9 @@ add_files (notmuch_database_t *notmuch, > > } > > db_mtime = directory ? notmuch_directory_get_mtime (directory) : 0; > > > > + if (directory && db_mtime == fs_mtime && st.st_nlink == 2) > > + goto DONE; > > + > > /* If the database knows about this directory, then we sort based > > * on strcmp to match the database sorting. Otherwise, we can do > > * inode-based sorting for faster filesystem operation. */ > > > I'm sorry for my late reply. It cuts the average time of 'notmuch new' > from 25s to 0.2s . Which is a bit scary :) But understandable. I have > the notmuch database on NFS mount which hopefully won't make any > difference here. Is there anything missing before including the patch into notmuch sources? Today I rebuilt notmuch and forgot to include this patch and "notmuch new" is dead slow again. Cheers -- Vlad