Repository navigation
[PM-45308] perf(cli): Skip storage writes that change nothing - #23957
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## cli-perf/04-copy-json #23957 +/- ##
========================================================
Coverage ? 59.32%
========================================================
Files ? 4699
Lines ? 148737
Branches ? 23722
========================================================
Hits ? 88232
Misses ? 54343
Partials ? 6162 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR changes |
370a380 to
fda5fb2
Compare
fda5fb2 to
741f4f2
Compare
Each save rewrites the whole data.json, ~19 MB with a large vault, and `bw get item` saved two values that were already stored. Compare the stored JSON first and skip the write when it would not change. The update is still emitted, as before.
741f4f2 to
222c618
Compare
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-45308
📔 Objective
Each save rewrites the whole data.json (~19 MB with a large vault), and
bw get itemsaved two values that were already stored. The stored JSON is now compared first and the write skipped when it would not change. The update is still emitted, as before.⏱️ Benchmark
Before = the previous PR in this stack, after = this PR.
bw get item <id>bw get password <id>bw list itemsbw statusProd build (
npm run build:oss:prod) run asnode build/bw.js, Node 25.9.0, Apple M5 Pro. Account with 11,996 items on vault.usdev.bitwarden.pw (data.json ~19 MB), Bitwarden Desktop running. Harnessapps/cli/perf/bench.mjs: 3 interleaved rounds of 1 warmup + 5 runs per command; fastest run per round, median across rounds. Every run's output is checked.