emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Speeding up agenda display
@ 2009-12-30 19:06 Andrew J. Korty
  2009-12-30 19:20 ` Carsten Dominik
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew J. Korty @ 2009-12-30 19:06 UTC (permalink / raw)
  To: Org Mode

My agenda views take a couple seconds to build, and I'd like them to be faster.  I'm posting a portion of configuration and some profiling results here in case anyone can see any opportunities for optimization.

Some background: I don't use the diary at all -- this agenda view exists only to show me tasks that are due soon (and in this case, not tagged with @yard or @home).

Thanks,
ajk

(setq org-agenda-custom-commands
      '(("o" "Due at Office" agenda ""
         ((org-agenda-skip-function
           '(or (org-agenda-skip-entry-if '(notdeadline))
                (ajk/org-agenda-skip-if-not-due-soon)
                (ajk/org-agenda-skip-if-tagged-for-home)))))))

(defun ajk/org-skip-position ()
  (or (save-excursion
        (outline-next-heading)
        (point))
      (point-max)))

(defun ajk/org-agenda-skip-if-not-due-soon ()
  (unless (ajk/org-agenda-skip-if-due-soon)
    (ajk/org-skip-position)))

(defun ajk/org-agenda-skip-if-tagged-for-home ()
  (org-back-to-heading t)
  (let ((tags (org-get-tags)))
    (if (or (member "@home" tags)
            (member "@yard" tags))
        (ajk/org-skip-position))))

(defun ajk/org-agenda-skip-if-action ()
  (if (org-get-todo-state)
      (ajk/org-skip-position)))

org-agenda                                                    1           2.017599      2.017599
org-let                                                       1           1.33683       1.33683
org-agenda-list                                               1           1.336819      1.336819
org-agenda-get-day-entries                                    1           1.30812       1.30812
org-entry-get                                                 422         0.9243140000  0.0021903175
org-entry-properties                                          416         0.9203020000  0.0022122644
org-get-tags-at                                               418         0.6899759999  0.0016506602
org-agenda-get-restriction-and-command                        1           0.680728      0.680728
org-agenda-get-scheduled                                      1           0.663837      0.663837
org-up-heading-safe                                           1055        0.6547349999  0.0006206018
org-agenda-get-deadlines                                      1           0.545852      0.545852
org-agenda-skip-entry-if                                      416         0.1982539999  0.0004765721
org-agenda-skip-if                                            416         0.1969610000  0.0004734639
org-back-to-heading                                           2439        0.1005620000  4.123...e-05
org-agenda-get-timestamps                                     1           0.094435      0.094435
org-prepare-agenda                                            1           0.02532       0.02532
org-prepare-agenda-buffers                                    1           0.024896      0.024896
org-refresh-category-properties                               1           0.012516      0.012516
org-outline-level                                             1696        0.0119610000  7.052...e-06
org-deadline-close                                            178         0.0085670000  4.812...e-05
org-agenda-skip                                               416         0.0071490000  1.718...e-05
org-get-tags-string                                           424         0.0054299999  1.280...e-05
org-days-to-time                                              178         0.0048369999  2.717...e-05
org-at-date-range-p                                           101         0.0044149999  4.371...e-05
org-time-string-to-time                                       178         0.0023639999  1.328...e-05
org-get-todo-state                                            116         0.0021619999  1.863...e-05
org-agenda-get-blocks                                         1           0.002077      0.002077
org-entry-is-done-p                                           113         0.0019640000  1.738...e-05
org-finalize-agenda                                           1           0.001947      0.001947
org-agenda-dim-blocked-tasks                                  1           0.001868      0.001868
org-agenda-get-sexps                                          1           0.001698      0.001698
org-split-string                                              633         0.0016380000  2.587...e-06
org-get-property-block                                        6           0.001411      0.0002351666
org-on-heading-p                                              424         0.0013999999  3.301...e-06
org-parse-time-string                                         183         0.0013529999  7.393...e-06
org-block-todo-from-children-or-siblings-or-parent            2           0.001044      0.000522
org-format-agenda-item                                        2           0.000966      0.000483
org-fit-window-to-buffer                                      1           0.000891      0.000891
org-get-effort                                                2           0.000815      0.0004075
org-remove-uniherited-tags                                    627         0.0007940000  1.266...e-06
org-get-wdays                                                 180         0.0004619999  2.566...e-06
org-get-category                                              419         0.0004180000  9.976...e-07
org-trim                                                      111         0.0003930000  3.540...e-06
org-agenda-files                                              3           0.000329      0.0001096666
org-add-prop-inherited                                        250         0.0003230000  1.292...e-06
org-switch-to-buffer-other-window                             1           0.000287      0.000287
org-time-string-to-absolute                                   5           0.0002600000  5.200...e-05
org-agenda-mode                                               1           0.00025       0.00025
org-finalize-agenda-entries                                   1           0.000224      0.000224
org-get-priority                                              2           0.000195      9.75e-05
org-get-tags                                                  8           0.000177      2.2125e-05
org-check-agenda-file                                         2           0.000159      7.95e-05
org-closest-date                                              4           0.000158      3.95e-05
org-agenda-highlight-todo                                     2           0.000152      7.6e-05
org-get-agenda-file-buffer                                    2           0.000144      7.2e-05
org-find-base-buffer-visiting                                 2           0.000133      6.65e-05
org-uniquify                                                  5           0.000129      2.579...e-05
org-date-to-gregorian                                         8           8.199...e-05  1.024...e-05
org-days-to-iso-week                                          3           5.499...e-05  1.833...e-05
org-compile-prefix-format                                     1           5.2e-05       5.2e-05
org-agenda-format-date-aligned                                1           4.6e-05       4.6e-05
org-add-props                                                 9           3.999...e-05  4.444...e-06
org-agenda-new-marker                                         4           3.3e-05       8.25e-06
org-agenda-todayp                                             2           3.3e-05       1.65e-05
org-agenda-add-inherited-tags                                 2           2.8e-05       1.4e-05
org-agenda-align-tags                                         1           2.5e-05       2.5e-05
org-entries-lessp                                             1           2.3e-05       2.3e-05
org-agenda-fontify-priorities                                 1           1.5e-05       1.5e-05
org-activate-bracket-links                                    1           1e-05         1e-05
org-get-at-bol                                                4           9.999...e-06  2.499...e-06
org-agenda-mark-header-line                                   1           8e-06         8e-06
org-agenda-deadline-face                                      2           8e-06         4e-06
org-agenda-set-mode-name                                      1           7e-06         7e-06
org-agenda-add-time-grid-maybe                                1           7e-06         7e-06
org-hh:mm-string-to-minutes                                   1           7e-06         7e-06
org-add-hook                                                  2           7e-06         3.5e-06
org-region-active-p                                           1           6e-06         6e-06
org-overlays-in                                               3           5.999...e-06  2e-06
org-agenda-mark-clocking-task                                 1           5e-06         5e-06
org-downcase-keep-props                                       2           4e-06         2e-06
org-float-time                                                4           4e-06         1e-06
org-get-todo-face                                             2           4e-06         2e-06
org-before-change-function                                    1           4e-06         4e-06
org-agenda-reset-markers                                      1           3e-06         3e-06
org-agenda-post-command-hook                                  1           3e-06         3e-06
org-file-menu-entry                                           1           3e-06         3e-06
org-unhighlight                                               1           3e-06         3e-06
org-set-sorting-strategy                                      1           1e-06         1e-06
org-fit-agenda-window                                         1           1e-06         1e-06
org-agenda-ndays-to-span                                      1           1e-06         1e-06
org-font-lock-add-tag-faces                                   1           1e-06         1e-06

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-01-03 12:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-30 19:06 Speeding up agenda display Andrew J. Korty
2009-12-30 19:20 ` Carsten Dominik
2009-12-30 19:40   ` Andrew J. Korty
2009-12-31  7:45     ` Carsten Dominik
2009-12-31 17:46       ` Andrew J. Korty
2010-01-02  7:50         ` Carsten Dominik
2010-01-02 14:38           ` Andrew J. Korty
2010-01-02 19:37             ` Carsten Dominik
2010-01-03  3:40               ` Andrew J. Korty
2010-01-03 12:42                 ` Carsten Dominik

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