emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Adam Porter <adam@alphapapa.net>
To: emacs-orgmode@gnu.org
Subject: Re: Slow speed of week and month views
Date: Sun, 06 Aug 2017 05:28:50 -0500	[thread overview]
Message-ID: <87zibdng65.fsf@alphapapa.net> (raw)
In-Reply-To: 2017-08-06T11-59-59@devnull.Karl-Voit.at

Karl Voit <devnull@Karl-Voit.at> writes:

>> 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 have it saved, here you go:

#+BEGIN_SRC elisp
  (defun scramble-contents ()
    (interactive)
    (let ((tree (org-element-parse-buffer)))
      (org-element-map tree '(code comment comment-block example-block fixed-width
                                   keyword link node-property plain-text verbatim)
        (lambda (obj)
          (cl-case (org-element-type obj)
            ((code comment comment-block example-block fixed-width keyword
                   node-property verbatim)
             (let ((value (org-element-property :value obj)))
               (org-element-put-property
                obj :value (replace-regexp-in-string "[[:alnum:]]" "x" value))))
            (link
             (unless (string= (org-element-property :type obj) "radio")
               (org-element-put-property obj :raw-link "http://orgmode.org")))
            (plain-text
             (org-element-set-element
              obj (replace-regexp-in-string "[[:alnum:]]" "x" obj)))))
        nil nil nil t)
      (let ((buffer (get-buffer-create "*Scrambled text*")))
        (with-current-buffer buffer
          (insert (org-element-interpret-data tree))
          (goto-char (point-min)))
        (switch-to-buffer buffer))))
#+END_SRC

The other one can be found here:

https://gist.github.com/alphapapa/2d141b60ccbe92f1b90000debde2ddd2

> 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.

Did you read the docstring?  ;)  It's intended to be run from an Org
source block with Babel.  Sorry, I should have emphasized that.  You can
rip out the lines that mess with the window and buffer if you just want
to run it directly and leave the results buffer open.

  reply	other threads:[~2017-08-06 10:29 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
2017-08-06 10:28                 ` Adam Porter [this message]
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=87zibdng65.fsf@alphapapa.net \
    --to=adam@alphapapa.net \
    --cc=emacs-orgmode@gnu.org \
    /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).