Tick the web GUI clock at 1s instead of 100ms - #28
Merged
Conversation
TimeService drives every live counter in the UI from one Observable.interval that starts at page load and never stops. Under zone.js each tick runs change detection across the whole component tree, so at 100ms the app re-evaluates every binding (including the impure ElapsedTimePipe, everywhere it appears) ten times a second, around the clock. Nothing can display what the extra ticks compute: ElapsedTimePipe and the station list's retry countdown both round to whole seconds, and TimeAgoPipe doesn't use TimeService at all. Ticking at 1s keeps every counter visually identical while cutting the change-detection churn by 90% — worth roughly 10-15 points of a core on the 2-core station PCs, on top of the animation fix in #27. dist/ rebuilt (bundle 5800c558), same node 16 workflow as #27. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Marcus Crane <marcus@utf9k.net>
Coverage Report for CI Build 31164577950Coverage remained the same at 60.612%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
TimeServiceis the GUI's single global clock: anObservable.interval(100)started at page load and never unsubscribed. zone.js turns every tick into app-wide change detection, so the page re-evaluates all bindings 10×/second forever — including thepure: falseElapsedTimePipeat every use site. On s-221 this is most of the content process's ~17%-of-a-core main-thread cost (the animations fixed in #27 were the rest).What
One line:
UPDATE_INTERVAL_MS100 → 1000, plus the dist rebuild (bundle5800c558).Every consumer displays whole seconds only —
ElapsedTimePiperounds to seconds, the station list'sretryCountdowndoesMath.round(remainingMs / 1000), andTimeAgoPipedoesn't use TimeService — so nothing on screen can look different. Worst case is a counter reading up to a second stale immediately after a phase starts; if that ever bothers anyone, 500ms still captures 80% of the saving.Notes
🤖 Generated with Claude Code