|
From: | Ilya Shlyakhter |
Subject: | Re: [O] [PATCH] tags search: faster tags matcher by trusting scanner tags |
Date: | Fri, 16 Mar 2012 00:31:13 -0400 |
I haven't looked at your patch carefully enough to know if it will orIlya Shlyakhter <address@hidden> wrote:
> 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?
>
will not cause problems, but check the doc for org-map-entries: it has
some guidelines about where the technique can be used and where it
cannot:
,----
| If your function needs to retrieve the tags including inherited tags
| at the *current* entry, you can use the value of the variable
| `org-scanner-tags' which will be much faster than getting the value
| with `org-get-tags-at'. If your function gets properties with
| `org-entry-properties' at the *current* entry, bind `org-trust-scanner-tags'
| to t around the call to `org-entry-properties' to get the same speedup.
| Note that if your function moves around to retrieve tags and properties at
| a *different* entry, you cannot use these techniques.
`----
There are warnings that this variable is for internal dynamical scoping only,
so I suspect you should not mess with the default. If your search can make
the needed guarantees, then you can just wrap it in a let to get the speedup.
Otherwise, it probably should be left alone.
Nick
0002-Tags-properties-matcher-faster-matching-by-trusting-.patch
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |