Skip to content

fix(js): fixed caching performance issues#1604

Open
eric-zaharia wants to merge 7 commits intov4from
fix/localstorage-cache-perf
Open

fix(js): fixed caching performance issues#1604
eric-zaharia wants to merge 7 commits intov4from
fix/localstorage-cache-perf

Conversation

@eric-zaharia
Copy link
Contributor

@eric-zaharia eric-zaharia commented Feb 16, 2026

Reduces localStorage blocking in createBrowserLocalStorageCache to improve INP by merging two filter passes into one (cutting get() from 2 reads + 2 writes to 1 read + 1 write) and creating new macrotasks (instead of waiting for the microtask queue to finish synchronously) via setTimeout before heavy work in get(), set(), and delete().

@eric-zaharia eric-zaharia self-assigned this Feb 16, 2026
@eric-zaharia eric-zaharia requested a review from Fluf22 February 17, 2026 08:29
Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt this is the only inefficient promise-related code, but if it works for your use case, lgtm. I personally would add tests and compare with v5 though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments