emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Discussion request: 15m tangle time, details follow
Date: Wed, 18 Jun 2014 11:34:19 +0200	[thread overview]
Message-ID: <87oaxqzhlw.fsf@gmail.com> (raw)
In-Reply-To: 8761jy1vh9.fsf@gmail.com

Thorsten Jolitz <tjolitz@gmail.com> writes:

> Grant Rettke <gcr@wisdomandwonder.com> writes:
>
>> The average build takes 15m. 

> [with-current-buffer "TC3F.org]

> After this is done *once*, you can always switch between emacs-lisp and
> org-mode with outorg, It takes 0.4 sec to convert the whole file to org
> again
>
> ,------------------------------------------
> | (benchmark-run (outorg-edit-as-org '(4)))
> | (0.365756325 1 0.13800897400000167)
> `------------------------------------------
>
> and 1.6 sec to convert it back to outshine (I have to fix this speed
> difference ;)
>
> ,---------------------------------------------
> | (benchmark-run (outorg-copy-edits-and-exit))
> | (1.616835235 8 1.106696710999998)
> `---------------------------------------------

This thread inspired me to profile these two commands - they do roughly
the same thing, only in the opposite direction, and I found it strange
why converting from Source to Org should be 4x faster than converting
from Org to Source. 

It turned out that 

,------------------------------------------------------------
| kill-whole-line is an interactive compiled Lisp function in
| `simple.el'.
`------------------------------------------------------------

was the sole culprit (used for killing the source-block
ddelimiters). Its a lisp function and does too many things besides
killing the line. Replacing it with C function

,------------------------------------------------------------------
| delete-region is an interactive built-in function in `editfns.c'.
`------------------------------------------------------------------

improves performance to (on whole file TC3):

,---------------------------------------------
| (benchmark-run (outorg-copy-edits-and-exit))
| (0.66580701 2 0.28894333600000266)
`---------------------------------------------

The remaining speed difference is partly because I undo the indendation 
introduced in the Org source-blocks before the conversion back to
source, and thus need to process the file twice. 

-- 
cheers,
Thorsten

  reply	other threads:[~2014-06-18  9:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18  0:16 Discussion request: 15m tangle time, details follow Grant Rettke
2014-06-18  2:41 ` Aaron Ecay
2014-06-18  8:13   ` Sebastien Vauban
2014-06-18 17:47     ` Aaron Ecay
2014-06-18 20:59   ` Eric Schulte
2014-06-19  1:05     ` Grant Rettke
2014-06-19 13:44       ` Eric Schulte
2014-06-20  0:01         ` Grant Rettke
2014-06-20  1:26           ` Grant Rettke
2014-06-20 14:50             ` Grant Rettke
2014-06-19  0:56   ` Grant Rettke
2014-06-18  2:54 ` Nick Dokos
2014-06-18  8:18 ` Thorsten Jolitz
2014-06-18  9:34   ` Thorsten Jolitz [this message]
2014-06-19  1:00   ` Grant Rettke
2014-06-18  8:20 ` Andreas Leha
2014-06-19  0:58   ` Grant Rettke

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=87oaxqzhlw.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --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).