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

cannot convert simple .md file to ePub (CPU leak) #2671

Closed
ousia opened this issue Jan 22, 2016 · 1 comment
Closed

cannot convert simple .md file to ePub (CPU leak) #2671

ousia opened this issue Jan 22, 2016 · 1 comment

Comments

@ousia
Copy link
Contributor

ousia commented Jan 22, 2016

I cannot convert http://ousia.tk/font-face.md into an ePub with version 1.16.0.2 (on Fedora 22).

pandoc -o font-face.epub font-face.md seems to enter in a CPU leak.

@ousia ousia changed the title cannot convert simple .md file to ePub cannot convert simple .md file to ePub (CPU leak) Jan 22, 2016
@jgm
Copy link
Owner

jgm commented Jan 22, 2016

This document has thousands of identically named headers.
I believe that is the problem. Translation slows down
as it goes, and it is almost certainly because
registerHeader uses a linked list of the previously
used header identifiers. Each time pandoc parses a
header, it needs to traverse this linked list. If the
list has thousands of elements, this can start to take
some time.

At least this hypothesis is consistent with the behavior
I'm seeing running a conversion to HTML.

There may also be a laziness-related space link. All this
can be solved by using better data structures, probably.
I didn't really think anyone would have more than a few
identically named headers -- and they won't appear in
real-world cases.

+++ Pablo Rodríguez [Jan 22 16 02:26 ]:

I cannot convert http://ousiatk/font-facemd into an ePub with version
11602 (on Fedora 22)

pandoc -o font-faceepub font-facemd seems to enter in a CPU leak


Reply to this email directly or [1]view it on GitHub.

References

  1. cannot convert simple .md file to ePub (CPU leak) #2671

@jgm jgm closed this as completed in 20170c3 Jan 22, 2016
c-forster pushed a commit to c-forster/pandoc that referenced this issue Mar 4, 2016
This avoids performance problems in documents with many identically
named headers.

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

No branches or pull requests

2 participants