emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Exporting large documents


From: Achim Gratz
Subject: Re: [O] Exporting large documents
Date: Mon, 06 May 2013 20:41:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Lawrence Mitchell writes:
> org-element--current-element takes (on my machine) 0.0003 seconds per
> call.  However, when exporting 128x the orgmanual introduction, it's
> called around 250000 times giving ~ 80 seconds total time (out of ~200
> total).

I've traced this a bit and the question does warrant further
investigation.  Exporting the introduction without any duplications
already shows some interesting things: the property drawer for the
introduction is scanned a whopping 137 times, followed by 134 times the
cindex entry following it, followed by 125 times the "Summary" headline.
The header options feature prominently with around 100 scans each as
well.

The rest of the calls have mostly just a single invocation, but there
are some instances where parts of the tree are traversed multiple times
in succession to apparently adjust the :end property to the leaf element
in small increments or decrements.  If elements are mutable during
parsing then caching is more difficult as well, obviously.

> So it sort of feels like actually what is needed is microoptimisations
> of the bits of the export engine that are called the most.

Looking at the traces I'd think if we could eliminate the repeated
backtracking to adjust the leafs or at least skip over those elements in
a backtrack that are already fully parsed instead of parsing them again,
that would be a good start.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves




reply via email to

[Prev in Thread] Current Thread [Next in Thread]