emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] How to improve Org startup time?


From: Sebastien Vauban
Subject: Re: [O] How to improve Org startup time?
Date: Wed, 30 Jan 2013 10:19:10 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.91 (windows-nt)

Hi Bastien,

Bastien wrote:
> "Sebastien Vauban" writes:
>
>> In particular, you'll see that *16 seconds* are "lost" between 21:20:30 and
>> 21:20:46. They correspond to the executiong of just *one line*:
>>
>> #+begin_src emacs-lisp
>>   (org-agenda-to-appt)
>> #+end_src
>>
>> This may have something to do with my big amount of Org files in
>> `org-agenda-files': 36 at this point. But is that so big??
>
> There are basically two factors that can slow down the agenda generation:
> the number of agenda files, the number of entries to check in all agenda
> files.
>
> Can you compare the time spent by the initialization process before and
> after commit 582cca5806 ?

I'll do at noon.

> It should improve things sensibly, I'd be curious to know why it does not
> improve anything -- if that's the case.
>
> Also, do you have any hooks in org-mode-hook?

Of course ;-)

Here, the full collection (in real life, they're at different spots of my
.emacs file):

--8<---------------cut here---------------start------------->8---
;; whitespace mode
(add-hook 'text-mode-hook
          (lambda ()
            (whitespace-mode 1)))

;; activate Auto Fill for all text mode buffers
(add-hook 'text-mode-hook 'turn-on-auto-fill)

(add-hook 'org-mode-hook
          (lambda ()
            (local-set-key (kbd "\C-\M-n") 'outline-next-visible-heading)
            (local-set-key (kbd "\C-\M-p") 'outline-previous-visible-heading)
            (local-set-key (kbd "\C-\M-u") 'outline-up-heading)))

(add-hook 'org-mode-hook
          (lambda ()
            ;; (local-set-key "\M-n" 'outline-next-visible-heading)
            ;; (local-set-key "\M-p" 'outline-previous-visible-heading)

            (local-set-key (kbd "C-c h") 'hide-other)

            ;; table
            (local-set-key "\M-\C-w" 'org-table-copy-region)
            (local-set-key "\M-\C-y" 'org-table-paste-rectangle)
            (local-set-key "\M-\C-l" 'org-table-sort-lines)))

(add-hook 'org-mode-hook
          (lambda() (add-to-list 'mode-line-format
                                 '(:eval (org-propertize
                                          (org-display-outline-path nil t " / " 
t)
                                         'face 'mode-line-emphasis
                                         'help-echo "Outline path")) t)))

(add-hook 'org-mode-hook
          (lambda ()
            (define-key org-agenda-keymap
              "L" 'lvn/org-agenda-toggle-list-category)
            (define-key org-agenda-mode-map
              "L" 'lvn/org-agenda-toggle-list-category)))

(add-hook 'org-mode-hook
          (lambda ()
            (setq imenu-generic-expression
                  org-src-blocks-imenu-generic-expression))))

(add-hook 'org-mode-hook
          (lambda ()
            ;; YASnippet (using the new org-cycle hooks)
            (set (make-local-variable 'yas/trigger-key) (kbd "tab")) ;; needed?
            (add-to-list 'org-tab-first-hook
                         'yas/org-very-safe-expand)
            (define-key yas/keymap (kbd "tab") 'yas/next-field) ;; needed?
            )))

(add-hook 'org-mode-hook
          (lambda ()
            (local-set-key (kbd "C-c m") 'org-mime-subtree)))
--8<---------------cut here---------------end--------------->8---

This is the result of searching for the following strings:

- text-mode-hook
- outline-mode-hook
- org-mode-hook

> Finally, org-agenda-to-appt is very slow by default, it uses
> org-agenda-get-day-entries and check every entry... see the docstring on how
> to make it check only the ones you really need.

Euh...

    ╭────
    │ org-agenda-get-day-entries is a Lisp function in `org-agenda.el'.
    │
    │ (org-agenda-get-day-entries &rest ARGS)
    │
    │ Not documented.
    ╰────

    ╭────
    │ org-agenda-to-appt is an interactive autoloaded Lisp function in
    │ `org-agenda.el'.
    │
    │ (org-agenda-to-appt &optional REFRESH FILTER &rest ARGS)
    │
    │ Not documented.
    ╰────

What am I missing?

Best regards,
  Seb

--
Sebastien Vauban




reply via email to

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