From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: How to improve Org startup time? Date: Thu, 31 Jan 2013 13:30:01 +0100 Message-ID: <86boc5tu0m.fsf@somewhere.org> References: <867gmviujs.fsf@somewhere.org> <87liba7zra.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain 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 Eric, Eric S Fraga wrote: > Sebastien Vauban writes: >> Please find here an enriched log of the packages which are loaded for Org, and >> the time it takes. >> >> [2013-01-29 21:20:18] (info) +-> Requiring `appt'... >> [2013-01-29 21:20:18] (info) +-> Requiring `diary-lib'... >> [2013-01-29 21:20:18] (info) +-> Requiring `calendar'... > > how do you get this output? It looks very useful! The timestamp stuff comes from EmacsWiki: #+begin_src emacs-lisp (defadvice message (before when-was-that activate) "Add timestamps to `message' output." (ad-set-arg 0 (concat (format-time-string "[%Y-%m-%d %T] ") (ad-get-arg 0)))) #+end_src The "call tree" between packages is originally written by me: #+begin_src emacs-lisp (defadvice require (around require-around activate) "Leave a trace of packages being loaded." (let* ((feature (ad-get-arg 0)) (require-depth (or (and (boundp 'require-depth) require-depth) 0)) (prefix (concat (make-string (* 2 require-depth) ? ) "+-> "))) (cond ((featurep feature) (message "(info) %sRequiring `%s'... already loaded" prefix feature) ;; in the case `ad-do-it' is not called, you have to set the ;; return value yourself! (setq ad-return-value feature)) (t (let ((lvn/time-start)) (message "(info) %sRequiring `%s'..." prefix feature) (setq lvn/time-start (float-time)) (let ((require-depth (1+ require-depth))) ad-do-it) (message "(info) %sRequiring `%s'... %s (loaded in %.2f s)" prefix feature (locate-library (symbol-name feature)) (- (float-time) lvn/time-start))))))) #+end_src You can further improve what you see in the echo area with: #+begin_src emacs-lisp (defadvice load (before debug-log activate) (message "(info) Loading %s..." (locate-library (ad-get-arg 0)))) (defadvice load-library (before debug-log activate) (message "(info) Loading library `%s'..." (locate-library (ad-get-arg 0)))) (defadvice load-file (before debug-log activate) (message "(info) Loading file `%s'..." (locate-library (ad-get-arg 0)))) (defadvice find-file (around find-file-around activate) "Open FILENAME and report time spent." (let ((filename (ad-get-arg 0)) (find-file-time-start (float-time))) (message "(info) Finding file %s..." filename) ad-do-it (message "(info) Found file %s in %.2f s." filename (- (float-time) find-file-time-start)))) #+end_src Adapt it to your taste (and report it!)... > In terms of the actual topic of this thread, I can say that the recent > changes to org for startup have led to a significant decrease in my > emacs startup time. Thanks to all that have done this! I hope to benefit from all that soon, as well... Best regards, Seb -- Sebastien Vauban