emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] ANN: org-ql agenda block support


From: Adam Porter
Subject: Re: [O] ANN: org-ql agenda block support
Date: Sat, 31 Aug 2019 00:20:52 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Mikhail Skorzhinskii <address@hidden> writes:

> Adam Porter <address@hidden> writes:
>  > However, the org-ql-block version runs in about 1/5th the time (0.7
>  > seconds compared to 3.45 seconds on my collection of org-agenda-files).
>
> For some reason I thought that on average org-ql package is working
> slower then native org-agenda searches. Probably because there are more
> control and interface is much more simpler and cleaner and nothing
> comes free of charge. That sort of thing. :-)

Well, it might also be because it used to be generally slower, and I
tried to be clear about that whenever I mentioned it.  :)  But I've
applied a lot of optimizations to it over the past few months, so it's
generally pretty fast now, sometimes much faster.  It's hard to make a
direct comparison in some cases, depending on the complexity of the
query.  I plan to continue optimizing it as I'm able, so hopefully it
will continue improving.

> I am really glad that I was mistaken. Care to drop a few thoughts on why
> this is the case? This is applicable only for ql-block or other org-ql
> functions are a bit faster too?

Well, it's a completely different implementation.  It has two main
features which attempt to make it fast: it uses regexp searches across
buffers as much as possible, similar to org-agenda.el but in a more
flexible way (though there's still room for improvement here, especially
with complex queries); and it caches results keyed on the query, buffer,
and narrowing (cached results are discarded when a buffer is modified),
which avoids re-running the same queries for unmodified buffers.  Oh,
and it also byte-compiles query predicates and action functions to eke
out a bit more speed.

And in general, I run benchmarks and try to improve performance when
possible; you can see some of the benchmark results in the notes.org
file in the repo (not all of which are up-to-date with current org-ql
code).

org-ql-block is just a way to make use of the results returned by org-ql
queries; other ways include org-ql-agenda, org-ql-search, and of course
you can use the raw results however you like, including calling whatever
:action function you like at matching entries, to return whatever kind
of data you need, or even perform actions directly on entries.

In other words, the querying code is separate from the display-related
code, so all org-ql-block, org-ql-agenda, org-ql-search, etc. do is
format results from org-ql queries and display them.

Upcoming features include an org-ql-sparse-tree command, like
org-sparse-tree but using org-ql queries; recursive queries; and
probably a timeline view like I recently posted about.

Please let me know if you have any feedback!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]