emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* new exporter - noweb substitution issues
@ 2012-11-20 21:40 cberry
  2012-11-21  6:33 ` cberry
  0 siblings, 1 reply; 6+ messages in thread
From: cberry @ 2012-11-20 21:40 UTC (permalink / raw)
  To: emacs-orgmode


When I tried to export a large subtree, it took over *5 minutes* to
export with release_7.9.2-597-gd4b739.

Using the contrib/lisp/*.el files from org-mode-7.8.11
it took *5 seconds*.

The subtree has a couple dozen '<<...>>'s in src blocks with ':noweb
yes' and the file itself is 9600 lines long. If I change all to 'noweb
no', then release_7.9.2-597-gd4b739 runs in about 5 seconds.

Both cases use:

  # Local variables:
  # *org-babel-use-quick-and-dirty-noweb-expansion*:t


I like to work interactively. Changing a little piece and then
re-exporting to see how it looks is really helpful for me.

Having to wait for 5 minutes to see how some small change affects the
results just won't work for me.

---

I also noticed on a toy test case (that does a lot of noweb lookups)
that the value of *org-babel-use-quick-and-dirty-noweb-expansion* seems
to have no effect on the reported difference between
(get-internal-run-time) eval'ed at the start and again at end of the
buffer exported using release_7.9.2-597-gd4b739.

FWIW, this toy case runs much faster even though the number of noweb
lookups is comparable. It is still slower than 7.8.11 iff I have 
*org-babel-use-quick-and-dirty-noweb-expansion*:t

If there is something I can do to shed more light on this please let me
know.
---

One other noweb issue is that the code from an *unexported* src block
cannot be used in subsequent blocks, which was not true for 7.8.11 and
is not true for the old exporter. If the unexported src block is before
the block that tries to copy its code, nothing is copied. I believe this
is because the same temp buffer is used to look up the code and to store
the result that is passed to the parser and unexported code gets deleted
before noweb expansions are completed.

---

Thanks,

Chuck

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: new exporter - noweb substitution issues
  2012-11-20 21:40 new exporter - noweb substitution issues cberry
@ 2012-11-21  6:33 ` cberry
  2012-11-22  5:10   ` [BUG] org-export-with-current-buffer-copy drops local variable WAS:Re: " cberry
  0 siblings, 1 reply; 6+ messages in thread
From: cberry @ 2012-11-21  6:33 UTC (permalink / raw)
  To: emacs-orgmode

cberry@tajo.ucsd.edu writes:

> When I tried to export a large subtree, it took over *5 minutes* to
> export with release_7.9.2-597-gd4b739.
>
> Using the contrib/lisp/*.el files from org-mode-7.8.11
> it took *5 seconds*.
>
> The subtree has a couple dozen '<<...>>'s in src blocks with ':noweb
> yes' and the file itself is 9600 lines long. If I change all to 'noweb
> no', then release_7.9.2-597-gd4b739 runs in about 5 seconds.
>
> Both cases use:
>
>   # Local variables:
>   # *org-babel-use-quick-and-dirty-noweb-expansion*:t


Further info:

ELP timing on a toy case:

| exporter  | function                         | Calls |        Total |     per call |
| old       | org-babel-params-from-properties |   149 | 1.1002899999 | 0.0073844966 |
| 7.8.11    | org-babel-params-from-properties |   142 |     0.966981 | 0.0068097253 |
| 7.9.2     | org-babel-params-from-properties |   280 | 1.7842110000 | 0.0063721821 |
| 7.9.2-nil | org-babel-params-from-properties |   280 | 1.7505480000 | 0.0062519571 |

The last line used  (setq *org-babel-use-quick-and-dirty-noweb-expansion* nil).

The only difference between '7.9.2' and '7.8.11' is I do this:

#+BEGIN_SRC emacs-lisp 
  (load "/Users/cberry/elisp/org-mode-7.8.11/contrib/lisp/org-element.el")
  (load "/Users/cberry/elisp/org-mode-7.8.11/contrib/lisp/org-export.el")
  (load "/Users/cberry/elisp/org-mode-7.8.11/contrib/lisp/org-e-latex.el")
#+END_SRC

to switch over to 7.8.11. In other words, all the babel stuff should
be the same, which includes org-export-preprocess-blocks. Right?

Could it be that the buffer local version
of *org-babel-use-quick-and-dirty-noweb-expansion* got lost??

Chuck

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [BUG] org-export-with-current-buffer-copy drops local variable WAS:Re: new exporter - noweb substitution issues
  2012-11-21  6:33 ` cberry
@ 2012-11-22  5:10   ` cberry
  2012-11-22 10:06     ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: cberry @ 2012-11-22  5:10 UTC (permalink / raw)
  To: emacs-orgmode

cberry@tajo.ucsd.edu writes:

> cberry@tajo.ucsd.edu writes:
>
>> When I tried to export a large subtree, it took over *5 minutes* to
>> export with release_7.9.2-597-gd4b739.
>>
>> Using the contrib/lisp/*.el files from org-mode-7.8.11
>> it took *5 seconds*.
>>
[...]
>>
>> Both cases use:
>>
>>   # Local variables:
>>   # *org-babel-use-quick-and-dirty-noweb-expansion*:t
>
[...]
>
> Could it be that the buffer local version
> of *org-babel-use-quick-and-dirty-noweb-expansion* got lost??
>

The answer is "YES".

org-export-with-current-buffer-copy calls org-clone-local-variables
which uses a regexp to detect buffer-local variables, but
*org-babel-use-quick-and-dirty-noweb-expansion* is not detected, so it
gets dropped.

Solution add "\\*org-babel-use-.*dirty.*\\*\\|" or something like that
to the regexp.

Chuck

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG] org-export-with-current-buffer-copy drops local variable WAS:Re: new exporter - noweb substitution issues
  2012-11-22  5:10   ` [BUG] org-export-with-current-buffer-copy drops local variable WAS:Re: " cberry
@ 2012-11-22 10:06     ` Nicolas Goaziou
  2012-11-28 19:40       ` cberry
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2012-11-22 10:06 UTC (permalink / raw)
  To: cberry; +Cc: emacs-orgmode, Eric Schulte

Hello,

cberry@tajo.ucsd.edu writes:

Thank you for all the debugging.

> org-export-with-current-buffer-copy calls org-clone-local-variables
> which uses a regexp to detect buffer-local variables, but
> *org-babel-use-quick-and-dirty-noweb-expansion* is not detected, so it
> gets dropped.
>
> Solution add "\\*org-babel-use-.*dirty.*\\*\\|" or something like that
> to the regexp.

Before doing that, I'd like to know if there's a particular reason for
this variable to not belong to the regular namespace.

I think this is confusing and error-prone. Thus, I'd rather have the
variable renamed instead.

Eric, is that ok with you?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG] org-export-with-current-buffer-copy drops local variable WAS:Re: new exporter - noweb substitution issues
  2012-11-22 10:06     ` Nicolas Goaziou
@ 2012-11-28 19:40       ` cberry
  2012-11-30 13:00         ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: cberry @ 2012-11-28 19:40 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> cberry@tajo.ucsd.edu writes:
>
> Thank you for all the debugging.
>
>> org-export-with-current-buffer-copy calls org-clone-local-variables
>> which uses a regexp to detect buffer-local variables, but
>> *org-babel-use-quick-and-dirty-noweb-expansion* is not detected, so it
>> gets dropped.
>>
>> Solution add "\\*org-babel-use-.*dirty.*\\*\\|" or something like that
>> to the regexp.
>
> Before doing that, I'd like to know if there's a particular reason for
> this variable to not belong to the regular namespace.
>
> I think this is confusing and error-prone. Thus, I'd rather have the
> variable renamed instead.

Fair enough.

>
> Eric, is that ok with you?

No reply so far, I think.

Anything more I can do to help with this?

Chuck

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG] org-export-with-current-buffer-copy drops local variable WAS:Re: new exporter - noweb substitution issues
  2012-11-28 19:40       ` cberry
@ 2012-11-30 13:00         ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2012-11-30 13:00 UTC (permalink / raw)
  To: cberry; +Cc: emacs-orgmode

cberry@tajo.ucsd.edu writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> Hello,
>>
>> cberry@tajo.ucsd.edu writes:
>>
>> Thank you for all the debugging.
>>
>>> org-export-with-current-buffer-copy calls org-clone-local-variables
>>> which uses a regexp to detect buffer-local variables, but
>>> *org-babel-use-quick-and-dirty-noweb-expansion* is not detected, so it
>>> gets dropped.
>>>
>>> Solution add "\\*org-babel-use-.*dirty.*\\*\\|" or something like that
>>> to the regexp.
>>
>> Before doing that, I'd like to know if there's a particular reason for
>> this variable to not belong to the regular namespace.
>>
>> I think this is confusing and error-prone. Thus, I'd rather have the
>> variable renamed instead.
>
> Fair enough.
>
>>
>> Eric, is that ok with you?
>
> No reply so far, I think.
>
> Anything more I can do to help with this?
>

I've renamed the variable. Thank you again.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-30 13:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-20 21:40 new exporter - noweb substitution issues cberry
2012-11-21  6:33 ` cberry
2012-11-22  5:10   ` [BUG] org-export-with-current-buffer-copy drops local variable WAS:Re: " cberry
2012-11-22 10:06     ` Nicolas Goaziou
2012-11-28 19:40       ` cberry
2012-11-30 13:00         ` Nicolas Goaziou

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).