From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: Discussion request: 15m tangle time, details follow Date: Wed, 18 Jun 2014 11:34:19 +0200 Message-ID: <87oaxqzhlw.fsf@gmail.com> References: <8761jy1vh9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxCGM-0004gt-UK for emacs-orgmode@gnu.org; Wed, 18 Jun 2014 05:34:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxCGH-0002Z9-43 for emacs-orgmode@gnu.org; Wed, 18 Jun 2014 05:34:38 -0400 Received: from plane.gmane.org ([80.91.229.3]:33574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxCGG-0002Yc-P0 for emacs-orgmode@gnu.org; Wed, 18 Jun 2014 05:34:33 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WxCGF-0001tt-35 for emacs-orgmode@gnu.org; Wed, 18 Jun 2014 11:34:31 +0200 Received: from e178189070.adsl.alicedsl.de ([85.178.189.70]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Jun 2014 11:34:31 +0200 Received: from tjolitz by e178189070.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Jun 2014 11:34:31 +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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Thorsten Jolitz writes: > Grant Rettke 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