Skip to content
Source
Sign inSign up
TanStack/db

perf: optimize hot paths in persistence, scheduling, and React hooks #1542

ClosedKyleAMathews(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromperfopened

Showing 9 changed files with 31 additions and 24 deletions (loading 6).

x
0 of 9 viewed, 9 left
7 additions and 0 deletions.changeset/optimize-hot-paths.mdAdded
View file
@@ -0,0 +1,7 @@
+---
+'@tanstack/db-sqlite-persistence-core': patch
+'@tanstack/offline-transactions': patch
+'@tanstack/react-db': patch
+---
+​
+Optimize hot paths: Schwartzian transform for stable serialization sorting, splice-based queue flushing, Map-based transaction lookups, Set-based filtering, and lazy property access in useLiveQuery so status-only consumers skip full entry materialization.
1 addition and 0 deletionspackage.jsonModified
View file
@@ -19,6 +19,7 @@
"prepare": "husky",
"test": "pnpm --filter \"./packages/**\" test",
"test:docs": "node scripts/verify-links.ts",
+ "bench:perf": "tsx scripts/perf-bench.ts",
"test:sherif": "sherif -i zod -p offline-transactions-react-native -p shopping-list-react-native",
"generate-docs": "node scripts/generate-docs.ts"
},
23 additions and 24 deletionspackages/db-sqlite-persistence-core/src/persisted.tsModified
View file
@@ -649,15 +649,15 @@