thorium-reader
thorium-reader copied to clipboard
Slow rendering on very large HTML resources in paginated mode
A recently published book, Le livre noir de ondes, that opens fine in Adobe Digital Editions, turns Thorium into an unresponsive app when opened. EPUB sent privately to Daniel Weck for debugging purposes.
Thank you for sharing the EPUB privately. This publication contains a very long HTML document which displays fine in scrolling mode in Thorium, but rendering degrades significantly when in paginated mode. The performance flamegraph shows a huge amount of time spent painting:
Yes, after emailing you the EPUB, I spent some time testing on my end, and I also noticed the very long HTML (it is actually the very first time I see something like this).
Thanks for pointing out about the "paginated" versus "scrolling" mode. I did not think of changing this display setting. It is definitely the type of book that needs to be read in this mode!
But this still raises a question... Is there not some improvement that could be done to the display routines of Thorium to not spend time rendering something that is not visible when in paginated mode?
Daniel and I discussed it briefly. The use of CSS column for pagination does not save CPU for invisible "pages", sadly. But Daniel will still check if the process is totally optimized, when he finds some time :-).
The baseline is still that we are here in front of bad authoring (I mean authoring which does not understand rendering issues in EPUB apps based on browser engines, what ADE is not).
Bonjour Laurent, thank you for your input. It makes perfect sense. Let's hope Daniel will be able to find some time in the not too distant future... So far, he's been pretty amazing at solving weird issues, often caused by poor EPUB authoring or rare bugs!
My plan is to attempt to reproduce the performance degradation using a reduced implementation of the pagination method used in Thorium to render HTML documents. In a nutshell: CSS Columns in a document hosted inside an Electron Webview which is itself embedded in an Electron BrowserWindow (in other words: this is an elimination process consisting removing the bulk of the additional Javascript event-based logic which drives the rendering / interaction logic)
I believe this is fixed in Thorium 2.1.0, please re-open if not.