LuteOrg/lute-v3

Ability to change the "bar of comprehension" in "books" from using the next five pages to whole book (Note: performance killer)

Opened this issue · 1 comments

Per Xolog in Discord:

Ability to change the "bar of comprehension" in "books" from viewing the next five pages/500 words to the whole book

My notes:

  • The original 5 page constraint was to deal with performance issues, but that has been improved quite a lot. Even so, increasing it to a very large number could run into a wall.
  • I was happy with the 5-page constraint because to me, the "stats" idea was less about the whole book overall, and was more about how difficult the next few pages were going to be to get through. I was reading a book that would change between very easy to really hard Spanish, depending on who was talking, so this stat was my idea of how much pain I was in for.
  • There's already an issue for calculating stats on a background thread, #150, perhaps that could combine with this somehow.

The code with the "5-page" constraint is in lute/book/stats.py, 5 is hardcoded in a routine at the top. This could pull from a user setting. It may create all sorts of problems though!

Size estimate notes:

  • test it out with a book with many many pages, see what the performance is like with a large number (at least on my machine)
  • change 5 to variable, pass it in
  • add numerical user setting to DB, 5 is the default
  • add to settings UI
  • update docs

This creates problems with long books -- I tried it out with a Spanish book of 600 pages, and the stats update for the whole book took several seconds. That would be extremely annoying, because it causes a long stats calc lag time every time I open up the book and even read just one page.

Of course stats could be calculated differently, perhaps cached etc, but that creates other problems -- cache management, invalidation, updates, etc.