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 21987431FD0 for ; Thu, 10 Nov 2011 20:51:19 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 XBp+59EK2CGX for ; Thu, 10 Nov 2011 20:51:18 -0800 (PST) Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU [18.7.68.37]) by olra.theworths.org (Postfix) with ESMTP id 7B06A431FB6 for ; Thu, 10 Nov 2011 20:51:18 -0800 (PST) X-AuditID: 12074425-b7f116d0000008fe-a6-4ebca9c403db Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP id 83.F9.02302.4C9ACBE4; Thu, 10 Nov 2011 23:51:16 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id pAB4pFxx022119; Thu, 10 Nov 2011 23:51:16 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pAB4pDgp003577 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Thu, 10 Nov 2011 23:51:14 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1ROj7V-0002Nl-Ed; Thu, 10 Nov 2011 23:53:41 -0500 Date: Thu, 10 Nov 2011 23:53:41 -0500 From: Austin Clements To: Pieter Praet Subject: Re: [PATCH] emacs: Use a single buffer invisibility spec to fix quadratic search cost. Message-ID: <20111111045341.GS2658@mit.edu> References: <1320807328-13728-1-git-send-email-amdragon@mit.edu> <877h382jax.fsf@SSpaeth.de> <87d3czxsu9.fsf@praet.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87d3czxsu9.fsf@praet.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAKsWRmVeSWpSXmKPExsUixCmqrXtk5R4/gw+3JS2u35zJbPH79Q1m i1lz5jFaLP21m82BxWPnrLvsHs9W3WL26Nh3mdVj8ZelLAEsUVw2Kak5mWWpRfp2CVwZx759 ZCrYKFix7cZJ9gbGQ7xdjJwcEgImElMmnWaFsMUkLtxbz9bFyMUhJLCPUWL30W5mCGcDo8SS m0dYIZyTTBKfdzxlh3CWMErcvfoFrJ9FQFWitWU1E4jNJqAhsW3/ckYQW0RAWeL0k59ADRwc zAI5Es1LjUHCwgKJEm8ntTOD2LwC2hLLL02AWnCIUWLLwTZWiISgxMmZT1hAbGYBHYmdW++w QcyRllj+jwMiLC/RvHU22BxOAXWJuRsmgbWKCqhITDm5jW0Co/AsJJNmIZk0C2HSLCSTFjCy rGKUTcmt0s1NzMwpTk3WLU5OzMtLLdK10MvNLNFLTSndxAiKGHYX1R2MEw4pHWIU4GBU4uHl /LPbT4g1say4MvcQoyQHk5Ior+qKPX5CfEn5KZUZicUZ8UWlOanFQP9xMCuJ8MrmAeV4UxIr q1KL8mFS0hwsSuK8r3c4+AkJpCeWpGanphakFsFkZTg4lCR4JYCJQUiwKDU9tSItM6cEIc3E wQkynAdoeMwckOHFBYm5xZnpEPlTjIpS4rxPQS4SAElklObB9cIS2itGcaBXhHlZQFbwAJMh XPcroMFMQIM3u+8GGVySiJCSamCMUgpz4LZKNr+ropTyruheXOErUS7JzM2hm3ukeSba38s2 dLgy0+33/UtG5W0aPUxXV8aFJ54PvM3462H4hI+R2UfbrqgLy6j6m6k0L9rJ/0+bvyPHd2Fb eoHlZUe/fU7LhEXMDCYWC665m6hyq+rAatNb205ckDiz+1T7V3fL4lLrxb4zOZVYijMSDbWY i4oTAVseRLVDAwAA Cc: notmuch@notmuchmail.org, servilio 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: Fri, 11 Nov 2011 04:51:19 -0000 Quoth Pieter Praet on Nov 11 at 4:04 am: > On Thu, 10 Nov 2011 14:22:30 -0500, servilio wrote: > > On 10 November 2011 08:33, Sebastian Spaeth wrote: > > > On Tue,  8 Nov 2011 21:55:28 -0500, Austin Clements wrote: > > >>  emacs/notmuch.el |   11 +++-------- > > >>  1 files changed, 3 insertions(+), 8 deletions(-) > > > > > > > > > Tested and works great here! +1 for quick inclusion. > > > > I join the petition, I have been using for a couple of days and the > > difference is noticeable. > > > > Subjectively, I'm not seeing any difference, but that may be due to a > relatively recent machine, and Austin's recent rebase [1] of Istvan's > database patch [2] no doubt makes a huge difference as well. How many results? Since it's eliminating a quadratic factor, this only affects large search result buffers (and only once they grow large; the beginning of the buffer will come in just as quickly with or without this). > I've tried getting some hard numbers using > > #+begin_src sh > time emacs --eval '(progn > (notmuch) > (notmuch-search "*") > (while (get-buffer-process (current-buffer)) > (sleep-for 0.1)) > (kill-emacs))' > #+end_src > > ... but the results vary wildly on subsequent runs. For me, this doesn't actually display the results buffer (though I don't know why not), which means it won't test this, since the problem lies in the Emacs redisplay logic. However, I think it does yield a baseline of how long it takes to construct the buffer without displaying it. This is interesting because, while this patch does not achieve this baseline time, this patch combined with another one I have waiting in the wings, does. > How would one go about getting stable results? The results are quite stable for me, both timing it manually and using the command you gave above. The only non-obvious thing that comes to mind is that you're probably testing on multiple cores, in which case the kernel scheduler could introduce a lot of noise. You could try running numactl -C 0 emacs ... to see if there's any merit to this theory.