From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: Slow speed of week and month views Date: Sun, 06 Aug 2017 05:28:50 -0500 Message-ID: <87zibdng65.fsf@alphapapa.net> References: <87efsre565.fsf@grothesque.org> <878tiyr9tg.fsf@alphapapa.net> <2017-08-05T23-06-00@devnull.Karl-Voit.at> <87h8xlhccj.fsf@nicolasgoaziou.fr> <2017-08-06T09-54-26@devnull.Karl-Voit.at> <87tw1ldsdc.fsf@nicolasgoaziou.fr> <2017-08-06T10-41-07@devnull.Karl-Voit.at> <87a83doy7f.fsf@alphapapa.net> <2017-08-06T11-59-59@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1deInz-0005HO-QH for emacs-orgmode@gnu.org; Sun, 06 Aug 2017 06:29:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1deInw-0007ke-Lj for emacs-orgmode@gnu.org; Sun, 06 Aug 2017 06:29:07 -0400 Received: from [195.159.176.226] (port=57508 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1deInw-0007kY-Ew for emacs-orgmode@gnu.org; Sun, 06 Aug 2017 06:29:04 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1deInl-0000pl-Vl for emacs-orgmode@gnu.org; Sun, 06 Aug 2017 12:28:53 +0200 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@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Karl Voit 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.