From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: How to improve Org startup time? Date: Wed, 30 Jan 2013 10:19:10 +0100 Message-ID: <86d2wndo4x.fsf@somewhere.org> References: <867gmviujs.fsf@somewhere.org> <87txpzoagt.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org 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=C2=A0;-) 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-headin= g) (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")) ;; nee= ded? (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... =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 org-agenda-get-day-entries is a Lisp function in `org-agenda.= el'. =E2=94=82 =E2=94=82 (org-agenda-get-day-entries &rest ARGS) =E2=94=82 =E2=94=82 Not documented. =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 org-agenda-to-appt is an interactive autoloaded Lisp function= in =E2=94=82 `org-agenda.el'. =E2=94=82 =E2=94=82 (org-agenda-to-appt &optional REFRESH FILTER &rest ARGS) =E2=94=82 =E2=94=82 Not documented. =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 What am I missing? Best regards, Seb -- Sebastien Vauban