From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] speed of continued source blocks Date: Sun, 11 Dec 2011 09:53:30 -0700 Message-ID: <87sjkr6obt.fsf@gmx.com> References: <87hb18ngwj.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZmfu-0000Sf-87 for emacs-orgmode@gnu.org; Sun, 11 Dec 2011 11:54:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZmfr-0002y8-Vd for emacs-orgmode@gnu.org; Sun, 11 Dec 2011 11:54:54 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:51161 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RZmfr-0002y1-Nx for emacs-orgmode@gnu.org; Sun, 11 Dec 2011 11:54:51 -0500 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: Andreas Leha Cc: emacs-orgmode@gnu.org Hi Andreas, I've just pushed up a patch which should speed up the collection of continued source blocks. Please let me know if the performance increase is sufficient for your example, if not we can look at more dramatic methods of optimization or possibly at making the collection of such blocks conditional. One option to avoid this overhead could be to add the following #+PROPERTY: noweb no to the top of your Org-mode file. Best, Andreas Leha writes: > Hi all, > > there is a significant performance drop connected to (the quite old) commit > 8c37281cb63a0b5cb0d84d22960e3a33d7680d40 > ob-tangle: continued code blocks now implemented with the :noweb-ref header arg > which introduces the continued code blocks. > > On the test file ([fn:1] for the old syntax, [fn:2] for the new > syntax) do org-babel-expand-src-block (C-c C-v v) on > the first source code block to see the effect. > > Just before this commit I get instantaneous reaction (elp: [fn:3]), with > the commit I have to wait about 20 seconds (elp: [fn:4]) > Recently things improved a bit, but still it takes about 10 seconds > to expand the source block (elp: [fn:5]). > > Since working interactively with the (R-)code in the org-file is > impossible this way, here comes my question: > > Is it possible to either > (a) speed up the continued source blocks > or > (b) make the continued code blocks an optional feature > in order to improve the performance to the previous state again? > > I'd be happy with solution (b), but unfortunately, it is beyond my > elisp to do so. > > Any help highly appreciated, > Andreas > > > [fn:1] test file with old syntax: http://pastebin.com/aL9axJMJ > > [fn:2] test file with new syntax: http://pastebin.com/c42jS1Be > > [fn:3] elp result last good commit: > org-babel-expand-src-block 1 0.853276 0.853276 > org-edit-src-code 1 0.58143 0.58143 > org-entry-get 2220 0.4699039999 0.0002116684 > org-babel-edit-prep:R 1 0.46897 0.46897 > org-babel-R-initiate-session 1 0.468958 0.468958 > org-babel-expand-noweb-references 5 0.340635 0.0681270000 > org-babel-get-src-block-info 7 0.32633 0.0466185714 > org-babel-parse-src-block-match 7 0.3256329999 0.0465189999 > org-babel-params-from-properties 7 0.3117870000 0.0445410000 > org-entry-get-with-inheritance 518 0.3088709999 0.0005962760 > org-up-heading-safe 1702 0.0883419999 5.190...e-05 > org-get-property-block 1702 0.0846720000 4.974...e-05 > org-back-to-heading 3404 0.0623720000 1.832...e-05 > org-edit-src-find-region-and-lang 1 0.052575 0.052575 > org-before-first-heading-p 2220 0.0260470000 1.173...e-05 > org-babel-params-from-buffer 7 0.0117110000 0.0016730000 > org-outline-level 2886 0.0047120000 1.632...e-06 > org-babel-find-named-block 4 0.003625 0.00090625 > org-babel-merge-params 29 0.0014899999 5.137...e-05 > org-babel-parse-header-arguments 28 0.00076 2.714...e-05 > org-babel-where-is-src-block-head 7 0.000354 5.057...e-05 > org-do-remove-indentation 8 0.0003219999 4.024...e-05 > org-not-nil 518 0.0002629999 5.077...e-07 > org-babel-read 30 0.000171 5.700...e-06 > org-uniquify 96 0.0001619999 1.687...e-06 > org-src-switch-to-buffer 1 0.000161 0.000161 > org-switch-to-buffer-other-window 1 0.000153 0.000153 > org-edit-src-find-buffer 1 0.00014 0.00014 > org-mode-flyspell-verify 1 0.000123 0.000123 > org-babel-trim 4 8.999...e-05 2.249...e-05 > org-make-options-regexp 28 7.900...e-05 2.821...e-06 > org-babel-chomp 38 6.899...e-05 1.815...e-06 > org-babel-strip-protective-commas 7 6.000...e-05 8.571...e-06 > org-edit-src-get-indentation 1 5.4e-05 5.4e-05 > org-babel-number-p 30 5.000...e-05 1.666...e-06 > org-get-indentation 1 4.6e-05 4.6e-05 > org-babel-process-params 2 4.499...e-05 2.249...e-05 > org-babel-reverse-string 8 3.999...e-05 4.999...e-06 > org-babel-clean-text-properties 28 3.000...e-05 1.071...e-06 > org-src-mode 1 2.3e-05 2.3e-05 > org-babel-get-header 5 1.9e-05 3.8e-06 > org-babel-expand-body:R 1 1.9e-05 1.9e-05 > org-babel-named-src-block-regexp-for-name 4 1.399...e-05 3.499...e-06 > org-babel-variable-assignments:R 1 1.2e-05 1.2e-05 > org-edit-src-get-label-format 1 1.2e-05 1.2e-05 > org-src-babel-configure-edit-buffer 1 9e-06 9e-06 > org-src-mode-configure-edit-buffer 1 8e-06 8e-06 > org-edit-src-get-lang 1 6e-06 6e-06 > org-add-hook 1 5e-06 5e-06 > org-src-associate-babel-session 1 5e-06 5e-06 > org-move-to-column 1 4e-06 4e-06 > org-babel-disassemble-tables 2 2e-06 1e-06 > org-region-active-p 1 2e-06 2e-06 > org-number-sequence 1 2e-06 2e-06 > org-babel-comint-buffer-livep 2 2e-06 1e-06 > org-babel-R-graphical-output-file 1 1e-06 1e-06 > > [fn:4] elp result problematic commit > org-babel-expand-noweb-references 5 31.696517 6.3393034 > org-entry-get 130002 24.352512999 0.0001873241 > org-babel-expand-src-block 1 19.233299 19.233299 > org-babel-get-src-block-info 327 19.045015000 0.0582416360 > org-babel-parse-src-block-match 327 19.000417999 0.0581052538 > org-babel-params-from-properties 327 17.089966999 0.0522628960 > org-entry-get-with-inheritance 23838 16.555423999 0.0006944971 > org-up-heading-safe 106164 7.4488420000 7.016...e-05 > org-get-property-block 106164 4.4522569999 4.193...e-05 > org-before-first-heading-p 130002 2.1264209999 1.635...e-05 > org-back-to-heading 212328 1.7064339999 8.036...e-06 > org-babel-merge-params 1309 1.3357350000 0.0010204239 > org-babel-params-from-buffer 327 1.2614980000 0.0038577920 > org-outline-level 188490 0.9018869999 4.784...e-06 > org-edit-src-code 1 0.190142 0.190142 > org-babel-parse-header-arguments 1308 0.0611450000 4.674...e-05 > org-edit-src-find-region-and-lang 1 0.047875 0.047875 > org-do-remove-indentation 328 0.0269740000 8.223...e-05 > org-babel-where-is-src-block-head 327 0.0229660000 7.023...e-05 > org-not-nil 23838 0.0112739999 4.729...e-07 > org-babel-read 1578 0.0100570000 6.373...e-06 > org-uniquify 4217 0.0058860000 1.395...e-06 > org-babel-strip-protective-commas 327 0.0035549999 1.087...e-05 > org-make-options-regexp 1308 0.0032889999 2.514...e-06 > org-babel-chomp 1578 0.0030609999 1.939...e-06 > org-edit-src-exit 1 0.002847 0.002847 > org-babel-number-p 1578 0.0023579999 1.494...e-06 > org-babel-clean-text-properties 1305 0.0020099999 1.540...e-06 > org-match-string-no-properties 981 0.0014470000 1.475...e-06 > org-src-switch-to-buffer 2 0.000706 0.000353 > org-edit-src-find-buffer 1 0.000486 0.000486 > org-switch-to-buffer-other-window 2 0.000389 0.0001945 > org-babel-process-params 2 8.8e-05 4.4e-05 > org-mode-flyspell-verify 1 5.5e-05 5.5e-05 > org-babel-get-header 5 5.400...e-05 1.080...e-05 > org-src-mode 1 4.2e-05 4.2e-05 > org-edit-src-get-indentation 2 3.9e-05 1.95e-05 > org-babel-expand-body:R 1 3.6e-05 3.6e-05 > org-get-indentation 2 3.000...e-05 1.500...e-05 > org-src-babel-configure-edit-buffer 1 2.5e-05 2.5e-05 > org-babel-variable-assignments:R 1 2.4e-05 2.4e-05 > org-move-to-column 2 2.4e-05 1.2e-05 > org-src-associate-babel-session 1 2.2e-05 2.2e-05 > org-babel-edit-prep:R 1 1.9e-05 1.9e-05 > org-edit-src-get-lang 2 9e-06 4.5e-06 > org-src-mode-configure-edit-buffer 1 8e-06 8e-06 > org-edit-src-get-label-format 2 7e-06 3.5e-06 > org-babel-R-associate-session 1 6e-06 6e-06 > org-babel-R-initiate-session 1 6e-06 6e-06 > org-add-hook 1 5e-06 5e-06 > org-babel-comint-buffer-livep 2 4.999...e-06 2.499...e-06 > org-babel-disassemble-tables 2 4e-06 2e-06 > org-babel-R-graphical-output-file 1 2e-06 2e-06 > org-number-sequence 1 2e-06 2e-06 > org-region-active-p 1 1e-06 1e-06 > > [fn:5] elp result from the current HEAD (baae11d38ccf71d835c68b25dec88311f26625b4) > org-babel-expand-noweb-references 5 16.7724 3.35448 > org-entry-get 73866 14.340808999 0.0001941462 > org-babel-expand-src-block 1 10.147227 10.147227 > org-babel-get-src-block-info 327 10.072349999 0.0308022935 > org-babel-parse-src-block-match 327 10.051350000 0.0307380733 > org-babel-params-from-properties 327 9.8570869999 0.0301439969 > org-entry-get-with-inheritance 13554 9.6411849999 0.0007113165 > org-up-heading-safe 60312 4.0404989999 6.699...e-05 > org-get-property-block 60312 2.4755100000 4.104...e-05 > org-back-to-heading 120624 1.2751989999 1.057...e-05 > org-before-first-heading-p 73866 1.1468149999 1.552...e-05 > org-outline-level 107070 0.6830879999 6.379...e-06 > org-edit-src-code 1 0.06919 0.06919 > org-edit-src-find-region-and-lang 1 0.04786 0.04786 > org-babel-strip-protective-commas 327 0.0461469999 0.0001411223 > org-babel-merge-params 328 0.0270430000 8.244...e-05 > org-do-remove-indentation 328 0.0259550000 7.913...e-05 > org-babel-parse-header-arguments 327 0.0254640000 7.787...e-05 > org-babel-where-is-src-block-head 327 0.0111359999 3.405...e-05 > org-babel-balanced-split 351 0.0105150000 2.995...e-05 > org-babel-read 1578 0.0085669999 5.429...e-06 > org-babel-ref-goto-headline-id 4 0.0083590000 0.0020897500 > org-not-nil 13554 0.0065560000 4.836...e-07 > org-id-find-id-in-file 4 0.003685 0.00092125 > org-find-entry-with-id 4 0.0034720000 0.0008680000 > org-uniquify 2582 0.0033410000 1.293...e-06 > org-babel-number-p 1578 0.0026629999 1.687...e-06 > org-babel-parse-multiple-vars 645 0.0024450000 3.790...e-06 > org-babel-chomp 663 0.0013199999 1.990...e-06 > org-babel-clean-text-properties 1305 0.0009750000 7.471...e-07 > org-babel-trim 33 0.0004450000 1.348...e-05 > org-src-switch-to-buffer 1 0.000372 0.000372 > org-switch-to-buffer-other-window 1 0.000365 0.000365 > org-babel-join-splits-near-ch 33 0.0001880000 5.696...e-06 > org-edit-src-find-buffer 1 0.000187 0.000187 > org-babel-reverse-string 66 0.0001189999 1.803...e-06 > org-reduce 33 6.6e-05 2.000...e-06 > org-mode-flyspell-verify 1 5.9e-05 5.9e-05 > org-edit-src-get-indentation 2 4.5e-05 2.25e-05 > org-get-agenda-file-buffer 4 4.499...e-05 1.124...e-05 > org-babel-process-params 2 4.4e-05 2.2e-05 > org-get-indentation 2 3.7e-05 1.85e-05 > org-src-mode 1 3.7e-05 3.7e-05 > org-find-base-buffer-visiting 4 3.4e-05 8.5e-06 > org-src-babel-configure-edit-buffer 1 2e-05 2e-05 > org-babel-expand-body:R 1 2e-05 2e-05 > org-babel-get-header 5 1.7e-05 3.4e-06 > org-src-associate-babel-session 1 1.7e-05 1.7e-05 > org-babel-edit-prep:R 1 1.4e-05 1.4e-05 > org-babel-variable-assignments:R 1 1.1e-05 1.1e-05 > org-edit-src-get-lang 2 9.999...e-06 4.999...e-06 > org-src-mode-configure-edit-buffer 1 9e-06 9e-06 > org-id-find-id-file 4 9e-06 2.25e-06 > org-edit-src-get-label-format 2 8.000...e-06 4.000...e-06 > org-move-to-column 1 7e-06 7e-06 > org-babel-disassemble-tables 2 4e-06 2e-06 > org-babel-R-associate-session 1 4e-06 4e-06 > org-babel-R-initiate-session 1 4e-06 4e-06 > org-add-hook 1 4e-06 4e-06 > org-babel-comint-buffer-livep 2 3e-06 1.5e-06 > org-babel-R-graphical-output-file 1 2e-06 2e-06 > org-region-active-p 1 2e-06 2e-06 > org-number-sequence 1 2e-06 2e-06 > > -- Eric Schulte http://cs.unm.edu/~eschulte/