On 15/12/2010 18:17, Jean-Marc Lasgouttes wrote:
Le 15/12/2010 17:54, Michael Joyner a écrit :
One of our initial goals was to try and maintain an easy to edit file
format should the internal customers need to "tweak" any of the outputs.
The ones who would be doing the editing are less than technically
inclined.
Michael kindly sent to me an example file, and I can confirm the
problem. This file has nothing special, if you set aside that it is
11Mb and produces 1800 pages of pdf :)
sysprof points at latexParagraph (not its sibling) and by studying the
code I convinced myself that the problem lies in the test
if (distance(lastpar, par) >= distance(lastpar, endpar))
break;
If I am not mistaken, the pararaph list uses a RandomListIterator and
computing distances is done by walking the list. I think this creates
a quadratic behaviour. Am I wrong?
It seems correct. At the time I remember saying to myself that using
std::distance was not optimal and that we should use some new fast
method in RandomAccessList but I did not bother because it was fast
enough. So it is not fast enough for this use case it seems :-)
Looking at the code, I actually think we can get rid of the distance
call by using a for loop instead of while.
Abdel.