emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Karl Voit <devnull@Karl-Voit.at>
To: emacs-orgmode@gnu.org
Subject: Re: Slow speed of week and month views
Date: Sun, 6 Aug 2017 12:03:56 +0200	[thread overview]
Message-ID: <2017-08-06T11-59-59@devnull.Karl-Voit.at> (raw)
In-Reply-To: 87a83doy7f.fsf@alphapapa.net

Hi Adam,

* Adam Porter <adam@alphapapa.net> wrote:
> Karl Voit <devnull@Karl-Voit.at> 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	other threads:[~2017-08-06 10:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04 15:14 [Orgmode] Slow speed of week and month views Christoph Groth
2017-08-05  3:07 ` Adam Porter
2017-08-05 21:09   ` Karl Voit
2017-08-05 22:17     ` John Kitchin
2017-08-05 22:33       ` Nicolas Goaziou
2017-08-06  2:28       ` [Orgmode] " Tim Cross
2017-08-06  2:36       ` Adam Porter
2017-08-06  7:54       ` Karl Voit
2017-08-06 13:47         ` John Kitchin
2017-08-05 22:35     ` Nicolas Goaziou
2017-08-06  8:00       ` Karl Voit
2017-08-06  8:15         ` Nicolas Goaziou
2017-08-06  9:01           ` Karl Voit
2017-08-06  9:13             ` Adam Porter
2017-08-06 10:03               ` Karl Voit [this message]
2017-08-06 10:28                 ` Adam Porter
2017-08-06  9:26             ` Nicolas Goaziou
2017-08-06 10:18               ` Karl Voit
2017-08-07 11:41                 ` Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2010-02-16 19:58 Matt Lundin
2010-02-21  7:37 ` Carsten Dominik
2010-02-21 12:34   ` Matthew Lundin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2017-08-06T11-59-59@devnull.Karl-Voit.at \
    --to=devnull@karl-voit.at \
    --cc=emacs-orgmode@gnu.org \
    --cc=news1142@Karl-Voit.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).