Forum Bugs

Subset of document takes longer to render than entire document

MelGrubb
We are using Prince to generate PDF versions of the manuals generated by our project. We can render either a whole manual or just a single chapter. For some reason, one particular chapter takes longer to render than the entire manual (including the problem chapter). I've spent the better part of the last two days trying to figure out what's wrong.

I've saved the html of the single section as well as the whole manual as a file and run them through a diff tool. The chapter appears as an island in the middle of the larger document pretty much verbatim (apart from the styles being at the top of both documents)

I've taken the whole document and started cutting pieces out of it, looking for the critical error. I was expecting to find some kind of unbalanced quotes, unclosed tags or such, but I haven't found anything. There are large sections of user-submitted content in this file, some of which has been copied from Word documents including oddball styles and tables. I have removed these sections from the document and it made no difference.

Here's what I know.
The full, 42000-line document renders in 30 seconds.
The single, 33000-line chapter (the majority of the manual) renders in about 20 minutes.
The 64-bit release from 9/14 seems to do a little better at 10 minutes for the single chapter.

I have whittled the document down to a couple key sections that, when they are all present, will render quickly (10 seconds), but if any of them are removed it will take forever (3 and a half minutes). I then started eliminating content from one of those key sections trying to identify something incorrect, perhaps a badly encoded character somewhere.

Here's where it gets really weird:

I can now choose any single character from a certain paragraph in the remaining document and make the render take 3:30. Restoring that character will make it take 10 seconds again. Deleting another random character will jump up to 3:30 again. I have looked at the text in a hex editor, and there's nothing special about any of the characters I'm removing. They are all plain ASCII text characters. It does not seem to matter what character I decide to remove. I've seemingly hit some critical size on this one particular paragraph, and can't remove anything from it without killing my render time.

The more verbose logging in the recent build has no meaningful complaints. The delay seems to happen in the "resolving cross-references" step, even though none of the changes I'm making would involve cross-references that I can see.

I've run out of things to try. I'm out of ideas. Help?
mikeday
Can you email me (mikeday@yeslogic.com) the offending document that demonstrates the problem? It sounds like you may have hit on a very rare pathological situation involving cross-references.
MelGrubb
I'd like to, but we're trying to figure out the NDA implications on this end.
mikeday
The issue was related to the prince-shrink-to-fit property, and should be fixed in latest builds.