Rebuild the live event index in slices so it no longer freezes the pool #48
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/event-index-worker"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After each merge the pool rebuilt the live event index (Popular on TV and Live Sports) on the main thread, and every request waited 1-3.6 s for it. With the merge now in a worker (#47), this was the last regular freeze.
The build is too tied to the channel tiles and the guide to move to a worker cheaply: copying 161k channels and the merged guide over would block about as long as the build. So the build now pauses between steps instead:
buildEventIndex's work is a generator that yields once per channel, guide id or event, in the steps that took more than ~20 ms on the real pool (the channel pass, guide events, replays, ESPN schedule and networks, matchup merging, TV events).buildEventIndexruns it to the end in one go, as before.buildEventIndexSlicedruns it in slices of about 25 ms withsetImmediatein between.On the real 15 providers (161,760 channels, 431 games, 116 shows), three runs:
Tests: 144/144 pass, including a new one that the sliced build matches the one-go build and lets other work run.