5 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 6f49a05302 feat(perf): Optimize feed tag extraction with caching
- Extracted `getVideoTags` to `js/feedEngine/utils.js` with `WeakMap` caching.
- Updated `js/feedEngine/stages.js` and `js/feedEngine/kidsScoring.js` to use the cached utility.
- Removed redundant `collectVideoTags` and `normalizeTagSetFromVideo` functions.
- Added `benchmarks/feed_tags.mjs` to measure performance (approx 25x speedup in tight loops).
- Updated `hasDisinterestedTag` in `utils.js` to use the new utility.

This reduces object allocation and repeated string normalization during feed processing.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 19:44:30 +00:00
google-labs-jules[bot]andPR0M3TH3AN f954bf3d89 Optimize feed engine normalization with array marking
- Introduced `NORMALIZED_ARRAY_MARKER` in `js/feedEngine/utils.js` to tag arrays that are already normalized.
- Updated `normalizeItems` in `js/feedEngine/engine.js` to skip O(N) verification if the input array is marked.
- Updated built-in stages and sorters to mark their output arrays using `markAsNormalized` when they safely construct new arrays from normalized inputs.
- This avoids redundant O(N) scans after each stage, improving pipeline performance by ~10% end-to-end and eliminating overhead for trusted stages.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 17:00:52 +00:00
thePR0M3TH3AN 0ac64867da Add shared hashtag normalization helper 2026-01-18 13:35:34 -05:00
google-labs-jules[bot] 7d274bc331 feat: incorporate tag preferences into blacklist filter stage
- Implements `hasDisinterestedTag` helper in `js/feedEngine/utils.js` to check for disinterested tags in both raw Nostr tags and NIP-71 metadata.
- Updates `createBlacklistFilterStage` in `js/feedEngine/stages.js` to filter out videos matching `context.runtime.tagPreferences` disinterests.
- Ensures existing blacklist logic remains undisturbed.
- Verified with new unit test `tests/feed-engine-tag-pref.test.mjs` and existing feed engine tests.
2026-01-08 00:52:57 +00:00
thePR0M3TH3AN f81c97e5a8 feat: introduce feed engine module 2025-10-04 16:21:23 -04:00