emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Slow speed of week and month views


From: Karl Voit
Subject: Re: [O] Slow speed of week and month views
Date: Sun, 6 Aug 2017 12:03:56 +0200
User-agent: slrn/pre1.0.0-18 (Linux)

Hi Adam,

* Adam Porter <address@hidden> wrote:
> Karl Voit <address@hidden> writes:
>
>> With a fairly modified configuration (like mine on [0]) and a large
>> set of long Org-mode files I can't publish, it is hard to do
>> analysis here. So I can offer to report any performance annoyances
>> and anything you need to execute (report) on my side.
>
> It might be helpful if you posted a censored version of your large Org
> files somewhere.  There's a function by Nicolas that replaces all the
> characters with "x", and there's also a function that replaces words
> with random words of the same length (that one takes a while to run).

Nicolas, can you provide an URL for this? Sounds interesting.

>> I just learned about elp-instrument-package. What prefixes are of interest to
>> you?
>
> FYI, here's a handy "elp-profile" macro that automatically
> de-instruments after running.  It shows the top 20 functions by default,
> but you can adjust that easily.
>
> https://alphapapa.github.io/emacs-package-dev-handbook/#orgc830139

I executed following code below (without changing the prefixes yet
for testing purposes) which resulted in my usual Agenda but no
additional buffer showing any results. M-x elp-results is also
empty.

What did I do the wrong way?

(defmacro elp-profile (times &rest body)
  "Call this macro from an Org source block and you'll get a results block 
   showing which 20 functions were called the most times, how long they 
   took to run, etc. Set prefixes to a list of strings matching the prefixes 
   of the functions you want to instrument.

   Use it like this:
   (elp-profile 10
     (goto-char (point-min))
     (search-forward \"something\"))
  "
  (declare (indent defun))
  `(let ((prefixes '("string-" "s-" "buffer-" "append" "delq" "map"
                     "list" "car" "save-" "outline-" "delete-dups"
                     "sort" "line-" "nth" "concat" "char-to-string"
                     "rx-" "goto-" "when" "search-" "re-"))
         output)
     (dolist (prefix prefixes)
       (elp-instrument-package prefix))
     (dotimes (x ,times)
       ,@body)
     (elp-results)
     (elp-restore-all)
     (point-min)
     (forward-line 20)
     (delete-region (point) (point-max))
     (setq output (buffer-substring-no-properties (point-min) (point-max)))
     (kill-buffer)
     (delete-window)
     output))

(elp-profile 1
     (goto-char (point-min))
     (org-agenda-list))


-- 
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <
Personal Information Management > http://Karl-Voit.at/tags/pim/
Emacs-related > http://Karl-Voit.at/tags/emacs/




reply via email to

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