emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Adam Porter <adam@alphapapa.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Is there a way to get all agenda TODOs programmatically?
Date: Wed, 03 Jan 2018 14:49:25 +0100	[thread overview]
Message-ID: <878tdff3x6.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87vagjtgom.fsf@alphapapa.net> (Adam Porter's message of "Wed, 03 Jan 2018 03:50:01 -0600")

Hello,

Adam Porter <adam@alphapapa.net> writes:

> There are some examples of attempts at better APIs (e.g. my PoC
> org-agenda-ng code, Remy Honig's
> <https://github.com/remyhonig/org-query>, and some other people's
> personal configs here and there), but I'm guessing they all suffer from
> Emacs's function call overhead.  IIUC the agenda is as fast as it is
> because of the way it's largely written in large functions.  :)

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.

> 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.

Regards,

-- 
Nicolas Goaziou

  parent reply	other threads:[~2018-01-03 13:49 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 [this message]
2018-01-03 14:16                 ` Adam Porter

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=878tdff3x6.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=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).