perf: reduce timeline rendering and query work - #980
Draft
0xbrayo wants to merge 10 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #980 +/- ##
==========================================
+ Coverage 53.11% 60.12% +7.01%
==========================================
Files 48 51 +3
Lines 2984 3105 +121
Branches 681 762 +81
==========================================
+ Hits 1585 1867 +282
+ Misses 1379 1171 -208
- Partials 20 67 +47 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
The lint job fails CI with --max-warnings=0, tripped by no-shadow, no-unused-vars, and vue/order-in-components warnings introduced by the recent perf work.
0xbrayo
force-pushed
the
perf/timeline-and-activity
branch
from
September 11, 2026 05:09
a79ef7a to
c7fd937
Compare
Member
Author
start_loading unconditionally cleared category.by_period even when the current view doesn't request category history, which wiped out data the Report view reads directly without loading it itself.
Member
Author
Preserving category.by_period across views that skip reloading it was safe only as long as the underlying host/timeperiod/filters hadn't moved. Track the context the cache was computed for and clear it whenever the new query no longer matches, so a view like Report can't display category periods left over from a different context.
Member
Author
Deciding whether a skipped category-history load can keep the cached periods based on query options alone missed inputs that also shape the result: the compiled category rules and the resolved bucket IDs. Reuse the request that query_category_time_by_period already builds (query + periods) as the identity of the current by_period, and make the keep or clear decision in ensure_loaded once buckets are resolved, so a change to categorization or bucket configuration invalidates it too.
Member
Author
0xbrayo
marked this pull request as draft
September 11, 2026 09:17
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.
This reduces work on large ActivityWatch datasets by reusing timeline event requests, caching category-history periods with invalidation, and rendering only timeline items near the visible viewport. It also reuses compiled category rules, destroys visualization resources on unmount, and replaces repeated graph/chart aggregation scans with map-based accumulators.
Validation:
npm test(331 tests passed) andnpm run build.The branch contains six focused commits so each optimization can be reviewed independently.