Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very very slow conversion of a big listing or literal block #941

Closed
sytzek opened this issue Oct 10, 2018 · 2 comments
Closed

Very very slow conversion of a big listing or literal block #941

sytzek opened this issue Oct 10, 2018 · 2 comments
Assignees
Milestone

Comments

@sytzek
Copy link

sytzek commented Oct 10, 2018

Suppose I have a listing block of 10000 lines in asciidoc

----
line 1
line 2
...
line 10000
----

Converting this to PDF takes 20 minutes on my machine.
When I prepend every line with a space (marking every line as a literal paragraph) it takes about 20 seconds. That makes it less bad, but I loose the indentation because its a literal paragraph in stead of source listing.

I know a human author would not quickly write this kind of document, but I have creative users that dump the content of a generated file into the document...

@mojavelinux
Copy link
Member

This is just a limitation you have to keep in mind when using this converter. When making a PDF, it's necessary to create PDF objects for every single line. On top of that, the converter is trying to figure out where to place these lines onto the page. So it just takes time when you feed it very large documents.

@mojavelinux mojavelinux added this to the v2.0.0 milestone Jan 19, 2020
@mojavelinux
Copy link
Member

This issue was addressed in part by the fix for #2004. The converter now does the minimum amount of work it has to do to position the block and draw its border and background.

On my machine, it takes 12s to render a PDF with the sample you provided. It takes 6s to render it once in the scratch document to determine its extent, then another 6s to render it in the primary document atop its border and background. That's the best we can do with this converter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants