emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ilya Shlyakhter <ilya_shl@alum.mit.edu>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] tags search: faster tags matcher by trusting scanner tags
Date: Thu, 15 Mar 2012 19:16:06 -0400	[thread overview]
Message-ID: <CACfYvRY6HZYde9gmQTuVefOh8RObGzOZ_DY+HjSOPWTLX9oPyA@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 468 bytes --]

The attached patch speeds up tags matching ( 50s --> 5s for my most common
search ),
by turning on org-trust-scanner-tags within the matcher.

(When it's off, getting a non-inherited property's value causes a call to
org-entry-properties
to fetch all properties into a cache, including ALLTAGS; fetching ALLTAGS
involves
calling (org-get-tags-at), which is slow when org-trust-scanner-tags is
off.)

Can this cause problems / was this off for a reason?

thanks,

ilya

[-- Attachment #1.2: Type: text/html, Size: 525 bytes --]

[-- Attachment #2: 0022-Tags-matcher-turned-on-org-trust-scanner-tags-within.patch --]
[-- Type: application/octet-stream, Size: 1068 bytes --]

From 40ef4f9ba67a6b0466ca067d29f07c9a625929b4 Mon Sep 17 00:00:00 2001
From: Ilya Shlyakhter <ilya_shl@alum.mit.edu>
Date: Thu, 15 Mar 2012 19:05:06 -0400
Subject: [PATCH 22/22] Tags matcher: turned on org-trust-scanner-tags within
 the matcher.

* lisp/org.el (org-make-tags-matcher): Bind org-trust-scanner-tags to t
around the matcher, so that getting the ALLTAGS property does not take
so long.

TINYCHANGE
---
 lisp/org.el |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index ad63213..61f8716 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13133,7 +13133,7 @@ instead of the agenda files."
 	(setq tagsmatcher nil))
       (setq tagsmatcher (if (> (length orlist) 1) (cons 'or orlist) (car orlist)))
       (setq tagsmatcher
-	    (list 'progn '(setq org-cached-props nil) tagsmatcher)))
+	    (list 'let '((org-trust-scanner-tags t)) '(setq org-cached-props nil) tagsmatcher)))
     ;; Make the todo matcher
     (if (or (not todomatch) (not (string-match "\\S-" todomatch)))
 	(setq todomatcher t)
-- 
1.7.9.3


             reply	other threads:[~2012-03-15 23:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-15 23:16 Ilya Shlyakhter [this message]
2012-03-16  3:13 ` [PATCH] tags search: faster tags matcher by trusting scanner tags Nick Dokos
2012-03-16  4:31   ` Ilya Shlyakhter
2012-03-16  4:34     ` Ilya Shlyakhter
2012-03-16 10:35       ` Carsten Dominik
2012-03-16 14:25         ` Nick Dokos
2012-03-16  6:10     ` Nick Dokos
2012-03-16 14:13       ` Ilya Shlyakhter
2012-03-16 16:31         ` Carsten Dominik
2012-03-16 14:20       ` Ilya Shlyakhter
2012-03-16 16:35         ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACfYvRY6HZYde9gmQTuVefOh8RObGzOZ_DY+HjSOPWTLX9oPyA@mail.gmail.com \
    --to=ilya_shl@alum.mit.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).