emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ken Mankoff <mankoff@gmail.com>
To: Charles Berry <ccberry@ucsd.edu>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: Painfully Slow Export
Date: Tue, 12 Jun 2018 23:30:38 +0200	[thread overview]
Message-ID: <CAFdBzEojMqsyX+bUW49AgNxJJTN=cXrakqeWH7SkrjM37zHGjw@mail.gmail.com> (raw)
In-Reply-To: <CAFdBzEroEewFuOcj+WMFYrme5sZXvZ5c0Zv3jA1hd56dWBqrPQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2351 bytes --]

As an MWE, I can test with "emacs -Q" and the following org file:








#+PROPERTY: header-args :eval never-export
# (setq org-export-use-babel t)

#+BEGIN_SRC emacs-lisp :results none
(org-babel-do-load-languages
 'org-babel-load-languages
 '((shell . t)))
#+END_SRC

#+BEGIN_SRC sh :results org raw
for i in $(seq 200); do
echo ""
echo "#+BEGIN_SRC sh :results output :exports results"
echo "echo 'hello, world'"
echo "#+END_SRC"
echo "#+RESULTS:"
echo ": goodbye"
done
#+END_SRC
#+RESULTS:



Execute the first code block to allow execution of the second. Execute the
second code block to generate 200 more. Export. It takes ~6 seconds on my
machine, which seems long but is bearable. Based on the profiling, I think
the reason it takes 1 minute is because the code blocks use <<noweb>>
blocks?. I can verify this with the following MWE:


#+PROPERTY: header-args :eval never-export
# (setq org-export-use-babel t)

#+NAME: foo
#+BEGIN_SRC sh :results verbatim
ls
#+END_SRC
#+RESULTS:

#+NAME: bar
#+BEGIN_SRC sh :results verbatim :noweb yes
<<foo>>
#+END_SRC
#+RESULTS:

#+NAME: baz
#+BEGIN_SRC sh :results verbatim :noweb yes
<<bar>>
#+END_SRC
#+RESULTS:

Repeat the BAZ block with the <<bar>> about 100 times and export this, and
it takes a long time. I killed it after ~30 seconds, because I think I have
my evidence that :noweb yes is the culprit for the slow export.



On Tue, Jun 12, 2018 at 11:15 PM Ken Mankoff <mankoff@gmail.com> wrote:

>
> On Tue, Jun 12, 2018 at 11:07 PM Berry, Charles <ccberry@ucsd.edu> wrote:
>
>>
>> > On Jun 12, 2018, at 12:41 PM, Ken Mankoff <mankoff@gmail.com> wrote:
>> >
>> > Hi Chuck,
>> >
>> > It looks fine to me. I see:
>> >
>> > Name: fig:foo
>> > Lang: python
>> > Properties:
>> >       :header-args    :eval never-export
>> >       :header-args:python     nil
>> > Header Arguments:
>> >       :cache          no
>> >       :eval           never-export
>> >       :exports        results
>> >       :hlines         no
>> >       :noweb          yes
>> >       :results        file replace
>> >       :session        discharge_ts
>> >       :tangle         no
>> >
>> >
>>
>> And still the src blocks execute?
>>
>>
> No. The source blocks never execute. It just takes an entire minute to
> export the file with 200 source blocks. If they executed it would probably
> take a few hours.
>
>    -k.
>

[-- Attachment #2: Type: text/html, Size: 3970 bytes --]

  reply	other threads:[~2018-06-12 21:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 14:01 Painfully Slow Export Ken Mankoff
2018-06-12 15:09 ` Chris
2018-06-12 19:41   ` Ken Mankoff
2018-06-12 15:51 ` Berry, Charles
2018-06-12 19:41   ` Ken Mankoff
2018-06-12 21:07     ` Berry, Charles
2018-06-12 21:15       ` Ken Mankoff
2018-06-12 21:30         ` Ken Mankoff [this message]
2018-06-12 22:07           ` Berry, Charles
2018-06-13  5:32             ` Ken Mankoff
2018-06-13 17:55               ` Berry, Charles
2018-06-13 18:32                 ` Ken Mankoff
2018-06-14  4:42                 ` Ken Mankoff
2018-06-14 18:34                   ` BUG? WAS: " Berry, Charles
2018-06-23 21:06                     ` Nicolas Goaziou
2018-06-24  1:53                       ` Berry, Charles
2018-06-25 13:55                         ` Ken Mankoff

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='CAFdBzEojMqsyX+bUW49AgNxJJTN=cXrakqeWH7SkrjM37zHGjw@mail.gmail.com' \
    --to=mankoff@gmail.com \
    --cc=ccberry@ucsd.edu \
    --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).