perf(home): Ask for 6 hours of guide instead of 14 #36

Merged
namillis merged 1 commit from perf/home-guide-window into main 2026-11-09 16:27:12 +00:00
Owner

What was wrong

Home asked for the guide from 2 hours ago to 12 hours ahead. Home opens first, so that window, plus the cache's margins (EpgCachePolicy.downloadWindow: 2 hours before, 6 hours and the 3-hour TTL after), set what the pool's guide_window (#35) sends: 4 hours back and 21 ahead. That is 3.02 MB of the full guide's 3.40 MB, so #35 saved little.

What changed

  • HomeViewModel.kt asks for now to 6 hours ahead (HomeViewModel.guideWindow), the same reach as Search, Sports and the player. Home only shows what is on now, UP NEXT, and the channel info panel's next three programmes.
  • The window starts at now. A programme on now overlaps it whenever it started, so nothing on Home needs earlier hours. The cache's 2-hour lead still covers Search and Sports, which look 2 hours back.
  • The pool now sends 2 hours back and 14-15 ahead.
  • HomeGuideWindowTest.kt checks the entry Home's window creates serves the Guide at every width (2-8 hours), Search, Sports, the player, Favorites and Home itself, at several minutes past the hour and for the cache's 3 hours. The other screens' windows are copied from their view models, so a change there that this no longer covers fails the test.

Verified

  • testDebugUnitTest (620 tests), lintDebug and assembleDebug pass.
  • On the pool's full guide (tv3 test login), for the 2,294 channels with something on now, a window ending 6 hours ahead gives 99.9% their UP NEXT and 94% all three panel rows. At 4 hours it would be 87% for three rows; at 12 hours (as on main) 99.6%.
  • Pool download sizes for Home's window: main 3.02 MB, this branch 2.31 MB, full guide 3.40 MB.
  • LiveWireTV_API34 emulator with tv3, temporary logging (removed before commit), saved guide deleted before each cold start. Home asked for past_hours=2&future_hours=15, and download plus parse took 3.6 s (median of the 22 runs that used the window), against 4.2 s with #35 alone and 4.4 s before it. The channel info panel on CBS 9 Washington showed now and all three UP NEXT rows. After a relaunch, the Guide was served from the saved guide with no download.
  • In 4 of the 26 cold starts, pool_info took longer than the app's 3-second limit, so the app treated the pool as a plain panel and downloaded the full guide. That was already the case with #35; the guide was still correct.
## What was wrong Home asked for the guide from 2 hours ago to 12 hours ahead. Home opens first, so that window, plus the cache's margins (`EpgCachePolicy.downloadWindow`: 2 hours before, 6 hours and the 3-hour TTL after), set what the pool's `guide_window` (#35) sends: 4 hours back and 21 ahead. That is 3.02 MB of the full guide's 3.40 MB, so #35 saved little. ## What changed - `HomeViewModel.kt` asks for now to 6 hours ahead (`HomeViewModel.guideWindow`), the same reach as Search, Sports and the player. Home only shows what is on now, UP NEXT, and the channel info panel's next three programmes. - The window starts at now. A programme on now overlaps it whenever it started, so nothing on Home needs earlier hours. The cache's 2-hour lead still covers Search and Sports, which look 2 hours back. - The pool now sends 2 hours back and 14-15 ahead. - `HomeGuideWindowTest.kt` checks the entry Home's window creates serves the Guide at every width (2-8 hours), Search, Sports, the player, Favorites and Home itself, at several minutes past the hour and for the cache's 3 hours. The other screens' windows are copied from their view models, so a change there that this no longer covers fails the test. ## Verified - `testDebugUnitTest` (620 tests), `lintDebug` and `assembleDebug` pass. - On the pool's full guide (tv3 test login), for the 2,294 channels with something on now, a window ending 6 hours ahead gives 99.9% their UP NEXT and 94% all three panel rows. At 4 hours it would be 87% for three rows; at 12 hours (as on `main`) 99.6%. - Pool download sizes for Home's window: `main` 3.02 MB, this branch 2.31 MB, full guide 3.40 MB. - LiveWireTV_API34 emulator with tv3, temporary logging (removed before commit), saved guide deleted before each cold start. Home asked for `past_hours=2&future_hours=15`, and download plus parse took 3.6 s (median of the 22 runs that used the window), against 4.2 s with #35 alone and 4.4 s before it. The channel info panel on CBS 9 Washington showed now and all three UP NEXT rows. After a relaunch, the Guide was served from the saved guide with no download. - In 4 of the 26 cold starts, `pool_info` took longer than the app's 3-second limit, so the app treated the pool as a plain panel and downloaded the full guide. That was already the case with #35; the guide was still correct.
perf(home): Ask for 6 hours of guide instead of 14
All checks were successful
CI / test (pull_request) Successful in 6m47s
3bf23bd9c2
Home asked for the guide from 2 hours ago to 12 hours ahead. Home opens
first, so that window, plus the cache's margins, set what the pool's
guide_window sent: 4 hours back and 21 ahead, 3.02 MB of 3.40.

Home only shows what is on now, UP NEXT, and the channel info panel's
next three programmes. It now asks for now to 6 hours ahead, the same
reach as Search and the player. On the pool's guide that still gives
99.9% of channels their UP NEXT and 94% all three. The pool then sends
2 hours back and 14-15 ahead, 2.31 MB.

A programme on now overlaps a window starting at now whenever it
started, so nothing on Home needs the hours before. The cache's
2-hour lead still covers Search and Sports, which look 2 hours back.
HomeGuideWindowTest checks that the entry Home creates serves the
Guide at every width, Search, Sports, the player and Favorites for the
cache's 3 hours.
namillis deleted branch perf/home-guide-window 2026-11-09 16:27:12 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
namillis/LiveWireTV!36
No description provided.