Commit Graph
16 Commits
Author SHA1 Message Date
thePR0M3TH3AN 5f439d6863 Lazy-load recommendation indexes 2026-07-26 17:59:45 -04:00
google-labs-jules[bot]andPR0M3TH3AN 106f7640c4 fix(exploreData): trigger refresh immediately on visibility change
- `handleVisibility` only scheduled intervals but didn't trigger an immediate refresh when returning to the tab.
- This caused `tests/unit/services/exploreDataService.test.mjs` to fail (assertion `0 !== 1`).
- Added explicit calls to `refreshWatchHistoryTagCounts` and `refreshTagIdf` when `document.hidden` becomes false.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 15:10:29 +00:00
thePR0M3TH3AN 8bafe5f6e9 Merge branch 'unstable' into agents/daily/perf-agent-10905324702890843252 2026-02-18 09:38:12 -05:00
thePR0M3TH3AN 52039ec579 Merge branch 'unstable' into agents/daily/perf-agent-2026-02-15-8187656557724027488 2026-02-18 09:36:36 -05:00
thePR0M3TH3AN ed291a884a Merge branch 'unstable' into agents/daily/perf-agent-2026-02-15-3720994187998550610 2026-02-18 09:30:19 -05:00
google-labs-jules[bot]andPR0M3TH3AN 29982cfb63 perf: visibility-gate explore data intervals and fix lint crash
- Modifies `js/services/exploreDataService.js` to prevent starting background intervals if the document is hidden at initialization.
- Updates `scripts/check-hex.js` to increase max buffer size and exclude `js/webtorrent.min.js` to prevent `ENOBUFS` crashes.
- Adds `perf/hits-2026-02-17.json` inventory.
- Adds `daily-perf-report-2026-02-17.md` report.
- Adds `docs/agents/task-logs/daily/2026-02-17_06-45-57_perf-agent_completed.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 06:48:22 +00:00
google-labs-jules[bot]andPR0M3TH3AN c356e28ee5 perf: Implement visibility gating in ExploreDataService
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-15 12:50:12 +00:00
google-labs-jules[bot]andPR0M3TH3AN 268a980702 Run daily agent: perf-agent
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-15 09:48:40 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6181041b42 perf(explore): pause background updates when hidden
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-15 07:14:29 +00:00
google-labs-jules[bot]andPR0M3TH3AN 50390f9411 perf: implement visibility gating in ExploreDataService
- Pause `watchHistory` and `tagIdf` intervals when tab is hidden.
- Add `daily-perf-report-2026-02-15.md`.
- Add `perf/hits-2026-02-15.json`.
- Docs audit verified (no changes needed).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-15 04:01:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN 99e904d7c1 Optimize explore data worker transfer with lightweight video objects
- Implements `toLightweightVideo` helper in `js/services/exploreDataService.js` to strip large fields (content, signatures, etc.) from video objects before sending to the worker.
- Updates `buildWatchHistoryTagCounts` and `buildTagIdf` to use lightweight objects.
- Adds `tests/services/exploreDataService.optimization.test.mjs` to verify correctness.
- Adds `benchmarks/worker_transfer_lightweight_bench.js` demonstrating ~40% improvement in transfer time.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 17:15:25 +00:00
google-labs-jules[bot]andPR0M3TH3AN c47392aba6 Refactor numeric constants to centralized module
- Introduce `js/constants.js` with semantic time constants (e.g., `ONE_MINUTE_MS`, `STANDARD_TIMEOUT_MS`) and feature-specific TTLs.
- Export `KIND_MUTE_LIST` from `js/nostrEventSchemas.js` to standardize NIP-51 mute list kind usage.
- Refactor `js/state/cache.js`, `js/nostr/cachePolicies.js`, `js/channelProfile.js`, and various services to use centralized constants instead of hardcoded magic numbers.
- Update `js/nostr/relayConstants.js` to derive values from the shared time constants.
- Replace duplicate definitions of timeouts and retry delays across the codebase.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 03:27:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN fac5e00297 feat(perf): offload explore data computation to web worker
- Moved heavy tag counting and IDF calculation to `js/workers/exploreData.worker.js`.
- Extracted `collectVideoTags` to `js/utils/videoTags.js` (preserved original behavior).
- Extracted pointer normalization logic to `js/utils/pointerNormalization.js`.
- Refactored `js/services/exploreDataService.js` to use the worker.
- Added benchmark test `tests/benchmark-explore-data.spec.mjs`.

Measured Improvement:
- `buildTagIdf` execution time on main thread reduced from ~130ms blocking to ~0ms blocking (141ms total async time).
- Unblocks UI during periodic data refreshes.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 17:00:13 +00:00
google-labs-jules[bot]andPR0M3TH3AN 736ed3cbb1 Optimize collectVideoTags in ExploreDataService with WeakMap cache
- Implemented a module-level `WeakMap` to cache the results of `collectVideoTags` keyed by video object.
- This avoids repetitive tag parsing and normalization for the same video objects during `buildTagIdf` and `buildWatchHistoryTagCounts` cycles.
- Measured ~20% performance improvement on repeated calls in benchmark.
- Verified correctness with unit test covering cache hits and object mutations (simulated).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-03 16:49:49 +00:00
google-labs-jules[bot]andPR0M3TH3AN a0f893ace6 perf: optimize critical rendering and data processing paths
- Refactor `AmbientBackground` to use `ResizeObserver` instead of polling layout in animation loop.
- Implement async chunking for `ExploreDataService` to prevent main thread blocking during heavy calculations.
- Throttle `UrlHealthController` video probes to a maximum of 3 concurrent requests to prevent resource exhaustion.
- Document optimization tasks in `OPTIMIZATION_TASKS.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 15:27:25 +00:00
thePR0M3TH3AN 7de539ed84 Add explore data service for tag summaries 2026-01-22 19:20:41 -05:00