From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Regex Speedup for org-refresh-category-properties. Date: Tue, 29 Jul 2014 10:47:11 -0400 Message-ID: <871tt4jk7k.fsf@alphaville.bos.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC8gg-0007r3-7U for emacs-orgmode@gnu.org; Tue, 29 Jul 2014 10:47:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XC8gZ-0002UM-Mk for emacs-orgmode@gnu.org; Tue, 29 Jul 2014 10:47:34 -0400 Received: from plane.gmane.org ([80.91.229.3]:45629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC8gZ-0002UG-Fc for emacs-orgmode@gnu.org; Tue, 29 Jul 2014 10:47:27 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XC8gW-0005dy-Kw for emacs-orgmode@gnu.org; Tue, 29 Jul 2014 16:47:24 +0200 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jul 2014 16:47:24 +0200 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jul 2014 16:47:24 +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. > > Malcolm > > diff --git a/lisp/org.el b/lisp/org.el > index 7e30061..2fc6854 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -9474,7 +9474,7 @@ The refresh happens only for the current tree (not subtree)." > (goto-char (point-min)) > (put-text-property (point) (point-max) 'org-category def-cat) > (while (re-search-forward > - "^[ \t]*\\(#\\+CATEGORY:\\|[ \t]*:CATEGORY:\\)\\(.*\\)" nil t) > + "^[ \t]*\\(#\\+CATEGORY:\\|*:CATEGORY:\\)\\(.*\\)" nil t) ^ ^ What does the asterisk do? Can you explain what this regexp is supposed to match? Thanks, Nick