Skip to content

Performance: fix - throttle root persist writes and flush before suspend - #2315

Open
JohnathanWhite wants to merge 3 commits into
bitpay:developfrom
JohnathanWhite:fix/persist-throttle-and-flush
Open

Performance: fix - throttle root persist writes and flush before suspend#2315
JohnathanWhite wants to merge 3 commits into
bitpay:developfrom
JohnathanWhite:fix/persist-throttle-and-flush

Conversation

@JohnathanWhite

Copy link
Copy Markdown
Collaborator

redux-persist's throttle defaulted to 0, so the persist pipeline ran at maximum frequency; whenever the WALLET slice is dirty that pipeline re-runs pure-JS AES over six key fields per key and re-serializes merged BWC client objects. Throttling coalesces it. Because throttled writes can be starved indefinitely while several slices keep churning, persistence is now also flushed when the app backgrounds and after key create/import/delete. Also stops serializing the whole store twice at rehydrate for a log line.

redux-persist's throttle defaulted to 0, so the persist pipeline ran at maximum frequency; whenever the WALLET slice is dirty that pipeline re-runs pure-JS AES over six key fields per key and re-serializes merged BWC client objects. Throttling coalesces it. Because throttled writes can be starved indefinitely while several slices keep churning, persistence is now also flushed when the app backgrounds and after key create/import/delete. Also stops serializing the whole store twice at rehydrate for a log line.
@gabrielbazan7

Copy link
Copy Markdown
Collaborator

follow up: JohnathanWhite#7

Performance: ref - remove persist throttle and inactive flush
@JohnathanWhite
JohnathanWhite marked this pull request as ready for review August 25, 2026 14:39
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.

2 participants