mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
Optimizes `setProfileData` to defer blocking `JSON.stringify` and `localStorage.setItem` calls to idle periods, significantly reducing main thread blocking time during profile updates (e.g., watch history). - Adds `runIdle` helper with `requestIdleCallback` (fallback to `setTimeout`). - Updates `setProfileData` to use `runIdle`. - Updates `tests/profile-cache.test.mjs` to handle async persistence. - Adds `benchmarks/profile_cache_storage_bench.js` to measure blocking time (370x improvement observed). Co-authored-by: PR0M3TH3AN <[email protected]>