lemon24 / reader

A Python feed reader library.
https://reader.readthedocs.io
BSD 3-Clause "New" or "Revised" License
444 stars 37 forks source link

Web app? is slow #306

Closed lemon24 closed 1 year ago

lemon24 commented 1 year ago

(originally titled /feeds is slow)

On my deployment, for 180 feeds, /feeds renders in (after repeated refreshes):

For comparison:

Is this the library or the app?

lemon24 commented 1 year ago

OK, some timings taken with reader._plugins.timer (all times in seconds):

render reader methods
/feeds .20 .06 .01 get_feeds, .05 get_tag_keys (N calls)
/feeds?sort=unread .46 .31 .01 get_feeds, .05 get_tag_keys, .25 get_entry_counts (N calls)
/?limit=180 .26 .12 .06 get_entries, .09 get_tag (readtime plugin)
/?q=python&limit=180 .75 .59 .32 search_entries, .09 get_tag, .18 get_entries (N calls)

Some thoughts/conclusions:

2024-08 update: Have a look at https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-cached-table-counts for more ideas on caching.

lemon24 commented 1 year ago

With https://github.com/lemon24/reader/commit/dc04493eb41efaa0d8262def1d8bbc38dcdb9e4e and the figures above, I'm satisfied, for now.