johnfactotum/foliate

CPU spikes when left open

vsim3 opened this issue · 5 comments

vsim3 commented

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

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

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.

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

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

vsim3 commented

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).