Poucous / smartReader

Firefox and Chrome Extension for Smart Reading - Bionic Reader
https://addons.mozilla.org/firefox/addon/smartreader/
GNU General Public License v3.0
69 stars 9 forks source link

Perfomance issues on big page load or config change #15

Open listvin opened 10 months ago

listvin commented 10 months ago

FF freezes for up to a minute in some scenarios.

A. Long pages, not just infinite scroll. Now I noticed that in this case only first two screens are processed.

  1. sR is enabled, so far so good, there are little tabs for cleaner experiment
  2. Open Wikipedia
  3. Make yourself a coffee or whatever poison you prefer :coffee:

B. I have lot's of tab opened (50+ i think, in different windows and workspaces, I am not that mad) and something changes, primarily:

FF on Linux Mint 21 Cinnamon on desktop with i5 6th gen and 50GB RAM. Only 20% free at the moment and some swap used tho :thinking: Nothing bothers CPU during experiments, but experiment itself causes 100% spike on all cores.

listvin commented 10 months ago

Suggestion for case B -- it seems FF in mentioned situations lightly refreshes all loaded pages. Probably it's possible to do some check if page is open or before applying/reapplying transformation? Not sure if DR does this, probably its' CSS manipulations are free relatively to raping DOM with thousands of tiny objects. Such check of page presence might be simple to implement

listvin commented 10 months ago

Suggestion for case A -- manipulate only text blocks that are currently in the viewport +50% above/below. Might automatically improve case B a little.

listvin commented 10 months ago

Idea for case B.ii. When big page is already smart-read and extension becomes disabled, don't make any changes to DOM at all, just change CSS for .smart-readerBold class to empty style. Probably we need non-intrusive pop-up with buttons "refresh page" and "fix page", the latter does unraping thingie, even if it takes time, the user is more aware of consequences. Not having "fix" button is bad, in case user disables ext due to broken page with resubmission-sensitive content