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

Books with large chapters cause extreme lag #714

Open
MrXyfir opened this issue Jan 27, 2018 · 9 comments
Open

Books with large chapters cause extreme lag #714

MrXyfir opened this issue Jan 27, 2018 · 9 comments

Comments

@MrXyfir
Copy link

MrXyfir commented Jan 27, 2018

using v0.3.58

Testing on a book that has ~400 long paragraphs in most chapters and the browser slows dramatically, to where almost any action has a ~1 second delay. If I switch to a short chapter or another book with short chapters there's no problem. I've also tested on multiple books with large paragraphs and received the same results.

If I add display: none to the majority of the paragraph p elements then the lag instantly goes away. I was considering writing something to automatically hide and display only the appropriate elements but this screws up the pagination.

Any advice? At the current point certain books are basically unreadable. I can share a couple EPUB files I'm testing with but really any with large chapters should work.

@MrXyfir
Copy link
Author

MrXyfir commented Jan 29, 2018

I've done some more testing and using visibility: hidden instead of display: none prevents the pagination from breaking and eases the lag a noticeable, although still unacceptable amount that is nowhere near as effective as display: none.

@fchasen Will there be any changes in v0.4 or beyond regarding how chapters (especially large ones) are rendered? Do you have any suggestions on how to deal with this now in v0.3? I have a few ideas but you know the code base the best, there might be an obvious solution I'm not seeing.

@MrXyfir
Copy link
Author

MrXyfir commented Feb 16, 2018

Oddly, after many weeks, the lag has suddenly disappeared. I'll reopen if it returns.

@demeralde
Copy link

Hey @MrXyfir this still seems to be an issue, do you mind reopening it? See this issue for info.

@MrXyfir
Copy link
Author

MrXyfir commented Sep 7, 2020

@dspacejs No problem!

@MrXyfir MrXyfir reopened this Sep 7, 2020
@demeralde
Copy link

It'd be great if this can be fixed, it's been a huge pain.

@MrXyfir was it fixed when you switched to a different device or something with better specs?

@MrXyfir
Copy link
Author

MrXyfir commented Apr 10, 2021

@dspacejs No, it just mysteriously disappeared. It's possible my browser updated? I haven't used this in a long time.

That being said, display: none worked for me at the time. If I had to solve this again I would probably try hiding the elements with display: none and inserting an empty div or something with the correct size to prevent pagination issues.

Edit: Actually if I had to fix this issue today I'd fork the repo and just work on it myself since the author rarely responds to anyone.

@demeralde
Copy link

demeralde commented Apr 20, 2021

@MrXyfir I'm using another app (Foliate) which uses this library. So I'd have to fork that, fork epub.js and update the package used to this, and then deploy it locally as an app. That's a huge pain lol. It also means I don't get other updates to Foliate.

@MrXyfir
Copy link
Author

MrXyfir commented Apr 20, 2021

@dspacejs Ah, I see. Well best of luck finding a solution! Maybe you can convince the Foliate developer(s) to fork it.

@demeralde
Copy link

@MrXyfir good idea, I'll make a PR.

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