mertakdut / EpubParser

Parses .epub files, provides seperation page by page.
Apache License 2.0
118 stars 27 forks source link

Performance problem Content class #37

Open francogrex opened 3 years ago

francogrex commented 3 years ago

It becomes more and more sluggish as one moves along a book and on very large books it will crash because of that I think your proble lies in this code in the Content class, below:

    BookSection maintainBookSections(int index) throws ReadingException, OutOfPagesException {
        if (peakPage == index) { // Moving in order.
            peakPage++;
        } else {
            while (peakPage < index) { // Trying to move forward. Calculate the ones before first.
                getBookSection(peakPage++);
            }
        }
        return getBookSection(index);
    }
mertakdut commented 3 years ago

Hi. Can you provide heap dumps?