emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Adam Porter <adam@alphapapa.net>
To: emacs-orgmode@gnu.org
Subject: Re: Is there a way to get all agenda TODOs programmatically?
Date: Wed, 03 Jan 2018 08:16:44 -0600	[thread overview]
Message-ID: <87lghft4c3.fsf@alphapapa.net> (raw)
In-Reply-To: 878tdff3x6.fsf@nicolasgoaziou.fr

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

Hi Nicolas,

> I don't think the size of the functions matter much. Agenda is optimized
> for single day view, so it is fast in this case because it only looks
> for "interesting" headlines. However, this mechanism is terrible for
> multi-days agendas: Agenda treats them as multiple single days agendas,
> so you end up looking again and again at the same entries.

Yes, when I discovered that, I was very surprised that multi-day agendas
are as fast as they are!

>> An idea I had recently was to make more use of inline functions,
>> defsubst, etc, to avoid that.  It might let us make the code more
>> functional while letting the byte-compiler optimize it.  At the same
>> time, I wonder why it isn't already that way--maybe better Emacs
>> programmers know why it wouldn't be a good idea.
>
> Usually, you inline a function if you are certain funcall overhead is
> responsible for the slowness.

Thanks.  I checked my notes again, and I see that funcall overhead was
not actually the issue (at least, I hadn't gotten far enough for it to
be).  The problem was that org-element-parse-buffer was very slow in
comparison, since it parses the entire buffer rather than, as you said,
just interesting parts.  So I'm trying another approach that doesn't
parse the whole buffer, which seems to show promise...

      reply	other threads:[~2018-01-03 14:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-07  4:43 Is there a way to get all agenda TODOs programmatically? Marcin Borkowski
2017-10-07 14:20 ` Matt Lundin
2017-10-07 16:43   ` Marcin Borkowski
2017-10-07 16:54     ` Matt Lundin
2017-12-29 19:55       ` Marcin Borkowski
2017-12-31 23:37         ` Adam Porter
2018-01-03  9:31           ` Marcin Borkowski
2018-01-03  9:50             ` Adam Porter
2018-01-03 13:15               ` Adam Porter
2018-01-03 14:15                 ` Nicolas Goaziou
2018-01-03 15:48                   ` Adam Porter
2018-01-03 14:19                 ` Adam Porter
2018-01-03 13:49               ` Nicolas Goaziou
2018-01-03 14:16                 ` Adam Porter [this message]

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=87lghft4c3.fsf@alphapapa.net \
    --to=adam@alphapapa.net \
    --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).