From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: Regex Speedup for org-refresh-category-properties. Date: Tue, 29 Jul 2014 18:20:36 +0200 Message-ID: <87vbqgf86j.fsf@Rainer.invalid> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCA94-0004WV-Eu for emacs-orgmode@gnu.org; Tue, 29 Jul 2014 12:21:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCA8x-0007iq-Gf for emacs-orgmode@gnu.org; Tue, 29 Jul 2014 12:20:58 -0400 Received: from plane.gmane.org ([80.91.229.3]:49095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCA8x-0007ik-AF for emacs-orgmode@gnu.org; Tue, 29 Jul 2014 12:20:51 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XCA8w-0004EW-A6 for emacs-orgmode@gnu.org; Tue, 29 Jul 2014 18:20:50 +0200 Received: from pd9eb16aa.dip0.t-ipconnect.de ([217.235.22.170]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jul 2014 18:20:50 +0200 Received: from Stromeko by pd9eb16aa.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jul 2014 18:20:50 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Malcolm Purvis writes: > I use the master version of org, and some months ago the time required > to generate my custom agenda view sky rocketed. I've found that 90% of > the time was being spent in the call to re-search-forward in > org-refresh-category-properties. The patch below speeds up the regular > expression search and makes the generation of my agenda as fast as > before. I agree that this is faster, but it doesn't look right. Specifically I don't think you are matching CATEGORY drawers any longer. > - "^[ \t]*\\(#\\+CATEGORY:\\|[ \t]*:CATEGORY:\\)\\(.*\\)" nil t) > + "^[ \t]*\\(#\\+CATEGORY:\\|*:CATEGORY:\\)\\(.*\\)" nil t) I think that "^[ \t]*\\(\\(?:#\\+\\|:\\)CATEGORY:\\)\\(.*\\)" would be a better regex, assuming that the original regex was doing the right thing. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptation for Waldorf Blofeld V1.15B11: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada