From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly Date: Fri, 16 Nov 2012 08:45:41 -0700 Message-ID: <87obixilbh.fsf@gmail.com> References: <874nlappb1.fsf@tajo.ucsd.edu> <878vam1jvh.fsf@tajo.ucsd.edu> <3477.1351723988@alphaville> <11876.1351784283@alphaville> <14621.1351795682@alphaville> <87d2zgrhhr.fsf@gmail.com> <87a9ukr8xy.fsf@gmail.com> <87ehjwa8fg.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZOQW-0000fn-SD for emacs-orgmode@gnu.org; Fri, 16 Nov 2012 11:05:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TZOQT-0004ZD-QB for emacs-orgmode@gnu.org; Fri, 16 Nov 2012 11:05:56 -0500 Received: from mail-ie0-f169.google.com ([209.85.223.169]:35546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZOQT-0004Z7-JJ for emacs-orgmode@gnu.org; Fri, 16 Nov 2012 11:05:53 -0500 Received: by mail-ie0-f169.google.com with SMTP id 10so4739383ied.0 for ; Fri, 16 Nov 2012 08:05:53 -0800 (PST) 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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Andreas Leha writes: > tsd@tsdye.com (Thomas S. Dye) writes: > >> Aloha Aaron, >> >> Welcome to Org-mode. >> >> Aaron Ecay writes: >> >>> 2012ko azaroak 13an, John Hendy-ek idatzi zuen: >>> >>> [...] >>>> Crazy. I really wondered if it had something to do with trying to spit >>>> out the results into the minibuffer. Why is that behavior included? >>> >>> =E2=80=9C:results silent=E2=80=9D just means =E2=80=9Csilent except for= the minibuffer=E2=80=9D; IDK >>> why. >> > > [...] > > Just for the record: > I would also love to see the "really-silent results". > Yes, the existing ":results silent" option still echos the results to the minibuffer. It was originally added in the case where one does not want to change the Org-mode buffer (but would still like to see code block output). The attached patch adds a "really-silent" results header argument. To see the impact compare the running time of the following two code blocks. #+begin_src sh :results really-silent seq 100000000 #+end_src #+begin_src sh :results silent seq 100000000 #+end_src Before such a patch is applied it would need corresponding documentation, and the "really-silent" moniker may need to be reconsidered in favor of something more informative (the main purpose of this header argument is not silence but is rather avoiding all post processing), and ideally shorter as well. These new header arguments are of no value if they are not easily discover-able and easily remember-able to help others avoid the same issue that launched this thread. Cheers, --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-really-silent-header-avoids-result-post-process.patch >From 8ae5b59acdaaa271c797756bfe7f9479e1f9a277 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Fri, 16 Nov 2012 08:40:46 -0700 Subject: [PATCH] "really-silent" header avoids result post-process This patch introduces a new header argument which hide all code block results from Emacs so that they are not processed into Emacs-lisp objects; a process which may take a great deal of time for large objects. * lisp/ob.el (org-babel-common-header-args-w-values): Adding the new "really-silent" header argument. (org-babel-execute-src-block): Don't do *any* result processing if the "really-silent" header argument has been specified. (org-babel-sha1-hash): Remove the really-silent header argument from header arg lists when calculating cache sums. (org-babel-insert-result): Flesh out some documentation. --- lisp/ob.el | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lisp/ob.el b/lisp/ob.el index 69a5c58..167fe1a 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -421,7 +421,7 @@ then run `org-babel-pop-to-session'." (padline . ((yes no))) (results . ((file list vector table scalar verbatim) (raw html latex org code pp drawer) - (replace silent append prepend) + (replace silent really-silent append prepend) (output value))) (rownames . ((no yes))) (sep . :any) @@ -562,6 +562,8 @@ block." (message "executing %s code block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 info)) "")) + (if (member "really-silent" result-params) + (message "result silenced") (setq result ((lambda (result) (if (and (eq (cdr (assoc :result-type params)) 'value) @@ -581,7 +583,8 @@ block." (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks 'org-babel-after-execute-hook) - result)) + result + ))) (setq call-process-region 'org-babel-call-process-region-original)))))) (defun org-babel-expand-body:generic (body params &optional var-lines) @@ -1028,7 +1031,8 @@ the current subtree." (sort (copy-sequence (nth 2 info)) (lambda (a b) (string< (car a) (car b))))) (let* ((rm (lambda (lst) - (dolist (p '("replace" "silent" "append" "prepend")) + (dolist (p '("replace" "silent" "really-silent" + "append" "prepend")) (setq lst (remove p lst))) lst)) (norm (lambda (arg) @@ -1851,7 +1855,10 @@ RESULT-PARAMS can take the following values: replace - (default option) insert results after the source block replacing any previously inserted results -silent -- no results are inserted +silent -- no results are inserted into the Org-mode buffer but + the results are echoed to the minibuffer and are + ingested by Emacs (a potentially time consuming + process) file ---- the results are interpreted as a file path, and are inserted into the buffer using the Org-mode file syntax -- 1.8.0 --=-=-= Content-Type: text/plain -- Eric Schulte http://cs.unm.edu/~eschulte --=-=-=--