emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Adam Porter <adam@alphapapa.net>
To: emacs-orgmode@gnu.org
Subject: Re: working with tables can be quite painful...
Date: Sat, 17 Sep 2016 10:22:06 -0500	[thread overview]
Message-ID: <87y42qo8kh.fsf@alphapapa.net> (raw)
In-Reply-To: 87fuoyrjxe.fsf@saiph.selenimh

In case this helps anyone, I've found this code makes profiling a lot
easier.  It automatically instruments the desired functions, runs the
code you want to test, removes the instrumentation, and presents the
results.

#+BEGIN_SRC elisp
  (defmacro profile-org (times &rest body)
    `(let (output)
       (dolist (p '("org-"))  ; symbol prefixes to instrument
         (elp-instrument-package p))
       (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))

  ;; Used like this:
  (profile-org 10
    (org-table-next-field)
    (org-table-align))
#+END_SRC

  reply	other threads:[~2016-09-17 15:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 14:53 working with tables can be quite painful Eric S Fraga
2016-09-17  8:48 ` Nicolas Goaziou
2016-09-17 15:22   ` Adam Porter [this message]
2016-09-17 15:37 ` Michael Brand
     [not found] ` <9ae6591e2754413885a96e19c2455472@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-09-19  8:33   ` Eric S Fraga
2016-09-19 12:58     ` Michael Welle
     [not found]     ` <df2f3c4ad6a34890ad82cd1d0d557003@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-09-19 14:23       ` Eric S Fraga
2016-09-19 17:54         ` Michael Welle
2016-09-22 19:52     ` Nicolas Goaziou
     [not found] ` <61c781eee3b64613a40a39b95bc54e63@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-09-19  8:36   ` Eric S Fraga
2016-09-20  8:54 ` Jacob Nielsen
     [not found] ` <b05decb709ba4f64932ba34835b08056@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-09-20  9:03   ` Eric S Fraga

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=87y42qo8kh.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).