Closed lemon24 closed 2 years ago
To do:
recent_sort
from the old oneDid some benchmarks / optimizations:
ids
CTE columns) – 25-27% better than baseline in benchmarks, slightly better in the web appI ran the benchmarks on my database:
python -u scripts/bench.py time -n1 -r16 --db db.sqlite --query elon \
get_entries_all get_entries_read search_entries_recent_all
$ bench.py diff 3.0 noopt --format=percent-decrease | grep -e ^stat -e '^ min'
stat number repeat num_entries get_entries_all get_entries_read search_entries_recent_all
min 1 16 0 15.7% 18.3% 3.5%
$ bench.py diff 3.0 idprefix --format=percent-decrease | grep -e ^stat -e '^ min'
stat number repeat num_entries get_entries_all get_entries_read search_entries_recent_all
min 1 16 0 25.6% 27.5% 2.7%
$ bench.py diff 3.0 str --format=percent-decrease | grep -e ^stat -e '^ min'
stat number repeat num_entries get_entries_all get_entries_read search_entries_recent_all
min 1 16 0 25.8% 27.8% 1.8%
Web app results (on my laptop; on an EC2 instance they look similar):
page generated in <min> (<avg>)
/?limit=64 /
3.0 .169 (~.20) 6.22 (~6.5)
noopt .240 (~.25) 6.13 (~6.3)
idprefix .166 (~.19) 6.06 (~6.3)
As of 2.12, the recent entry sort heuristic is defined as such:
For some feeds, entries can appear in the feed months after their published. Example: https://peps.python.org/peps.rss
It should be possible to opt in to see entries when they are added, regardless of published/updated.
Some avenues for doing this: