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