Skip to content

Apollo v1.10.2

Choose a tag to compare

@DPilat-Dev DPilat-Dev released this 09 Sep 01:25
· 25 commits to main since this release

The year recap took three and a half seconds to show anything. It now takes about one.

Why it was slow

Not the server. The recap walks back through your watch history until it reaches the start of the year, and each page it fetches decides whether another is needed — so they cannot be asked for all at once. Every one waited for the last to arrive and for the page to redraw before the next went out. Eight of those in a row was the delay.

Measured against a real server, the round trips were the entire expense: two hundred items take 161ms and a thousand take 214ms. So it asks for a thousand at a time now, and needs one or two requests where it used to need eight.

A bug that came with it

Larger pages made the recap describe itself wrongly. The walk stops either when it reaches the start of the year or when it runs out of room, and it was checking for running out of room first. With small pages the year was always reached comfortably before the limit; with large ones both arrived together, the limit won, and a complete year was labelled "these are the most recent 1,200 and the real totals are higher" when they were not.

It checks the year first now, and decides whether to show that warning by whether it actually reached the start of the year rather than by counting what it loaded.

Verified against a real library: the same 405 hours before and after, and the warning correctly absent.

Full changelog: v1.10.1...v1.10.2