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

CPU spikes when left open #76

Closed
vsim3 opened this issue Jun 17, 2019 · 5 comments
Closed

CPU spikes when left open #76

vsim3 opened this issue Jun 17, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@vsim3
Copy link

vsim3 commented Jun 17, 2019

Hi! Thanks for foliate.

Steps to reproduce the issue:
Open a ebook, scroll some page then left it open for ~1h
Screenshot_20190617_120546

Version: 1.2 and git master
OS: Fedora 30

@johnfactotum johnfactotum added the bug Something isn't working label Jun 17, 2019
@itprojects
Copy link
Contributor

Confirmed on Ubuntu 19.04, with spike of 25% CPU usage and large 80MB RAM usage for small 400kb file.

@johnfactotum
Copy link
Owner

johnfactotum commented Jun 20, 2019

Not sure what's causing this.

Using Web Inspector's Timeline tool, the only thing that's going on seems to be Epub.js polling for resize every 350ms.

If anyone wants to help test this, you can try deleting or commenting out line 4636 in src/assets/epub.js, and see if this still happens.

I just tested it and it seems the CPU spikes are gone.

@itprojects
Copy link
Contributor

Commenting out line 4636 most certainly helped. No known side effects, so far.

@itprojects
Copy link
Contributor

Long testing over hours, with regular page flips confirms commenting out line 4636 in epub.js is a fix.

@vsim3
Copy link
Author

vsim3 commented Jun 23, 2019

Yes, delete line 4636 indeed fix the spikes. One of the things I've noticed is that dictionary lookup sometimes not working, can workaround by maximize foliate (not sure it was there before deleting line 4636).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants