ci: benchmark PRs against main with the incremental update suite #1650
main fromrefs/pull/1650/head·merged by KyleAMathews Summary#
Extracts the incremental update benchmark from #1648 into a standalone suite and adds a CI workflow that automatically measures the performance impact of PRs against main.
What's included#
scripts/bench/incremental-update.ts— the benchmark from #1648, with the opt-in perf-tracing removed (those trace hooks only exist on that branch's instrumented code paths, so the extracted benchmark relies purely on its own wall-clock timing and runs against any revision). It measures per-write latency (median/p75/p95/min/max/stddev) plus cold hydrate time for five live-query shapes — filtered+ordered list, join, aggregate subquery, nested includes, detail view — across fixture scales (100/1k/10k rows), source index modes (none/manual), and mutation modes (synced/optimistic).scripts/bench/compare-incremental-update.ts— compares two benchmark reports and emits a markdown summary: per-case deltas with significance flags (default: >20% relative and >0.05ms absolute, so sub-ms jitter isn't flagged), plus geometric-mean ratios overall and per group to surface consistent shifts that are individually below the noise floor..github/workflows/benchmark.yml— runs on non-draft PRs that touchpackages/db,packages/db-ivm, or the benchmark itself (and onworkflow_dispatch). It benchmarks the PR merge commit and its merge-base withmainback-to-back on the same runner using the same benchmark code for both sides, then publishes the comparison as a job summary, uploads the raw reports as artifacts, and posts/updates a sticky PR comment (skipped gracefully for fork PRs, whose token is read-only — the job summary always has the results).
Trigger choice#
Draft PRs are skipped, so the benchmark starts when a PR is opened/marked ready for review and re-runs on pushes to it (with concurrency cancellation). Easy to tighten later (e.g. label-gated or on approval only) by changing the on:/if: conditions.
Validation#
- Benchmark runs green against current
main(the suite is decoupled from #1648's code changes). - Compared two same-code runs: overall geomean 1.01×, no significant changes flagged — the noise floor holds.
- Compared #1648's branch against
mainwith this tooling: overall geomean 0.86× with consistent per-group improvements at the 10k scale (down to 0.5× medians), demonstrating that real perf changes are clearly visible in the report. (It also flagged a >3× median regression for theissue detail + commentscase with optimistic writes at 10k scale on that branch — worth a look over there.) - Full local run takes ~12s (M2); the CI config uses 100 iterations + 20 warmup writes per case, so the whole job should stay in the low minutes.
- Workflow passes zizmor with no findings.
🤖 Generated with Claude Code
Summary by CodeRabbit#
- New Features
- Added a new Benchmark workflow that runs on pull requests and manual dispatch, generating baseline vs. candidate benchmark outputs and summaries.
- Introduced an incremental update benchmark runner with configurable scenarios, warmups, iterations, and detailed runtime metrics.
- Added a comparison tool that produces a Markdown report with regression/improvement detection and rich per-case breakdowns.
- Bug Fixes
- Improved handling for draft and forked pull requests when skipping runs and updating PR comments.
- Documentation
- Benchmark results are now posted to PR comments and included in job summaries for easier review.
- 1
More templates
- todos
- offline-first-electron
- @tanstack/db-example-react-action-enforcement
- @tanstack/db-example-react-next-ssr-e2e
- tanstack-start-example-basic
- @tanstack/db-example-paced-mutations-demo
- tanstack-start-db-projects-example
- @tanstack/db-example-react-start-ssr-e2e
- @tanstack/db-example-react-todo
- offline-transactions-react-native
- shopping-list-react-native
- @tanstack/db-example-solid-todo
@tanstack/angular-db
npm i https://pkg.pr.new/@tanstack/angular-db@1650@tanstack/browser-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/browser-db-sqlite-persistence@1650@tanstack/capacitor-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/capacitor-db-sqlite-persistence@1650@tanstack/cloudflare-durable-objects-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/cloudflare-durable-objects-db-sqlite-persistence@1650@tanstack/db
npm i https://pkg.pr.new/@tanstack/db@1650@tanstack/db-ivm
npm i https://pkg.pr.new/@tanstack/db-ivm@1650@tanstack/db-sqlite-persistence-core
npm i https://pkg.pr.new/@tanstack/db-sqlite-persistence-core@1650@tanstack/electric-db-collection
npm i https://pkg.pr.new/@tanstack/electric-db-collection@1650@tanstack/electron-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/electron-db-sqlite-persistence@1650@tanstack/expo-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/expo-db-sqlite-persistence@1650@tanstack/node-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/node-db-sqlite-persistence@1650@tanstack/offline-transactions
npm i https://pkg.pr.new/@tanstack/offline-transactions@1650@tanstack/powersync-db-collection
npm i https://pkg.pr.new/@tanstack/powersync-db-collection@1650@tanstack/query-db-collection
npm i https://pkg.pr.new/@tanstack/query-db-collection@1650@tanstack/react-db
npm i https://pkg.pr.new/@tanstack/react-db@1650@tanstack/react-native-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/react-native-db-sqlite-persistence@1650@tanstack/react-router-with-db
npm i https://pkg.pr.new/@tanstack/react-router-with-db@1650@tanstack/rxdb-db-collection
npm i https://pkg.pr.new/@tanstack/rxdb-db-collection@1650@tanstack/solid-db
npm i https://pkg.pr.new/@tanstack/solid-db@1650@tanstack/svelte-db
npm i https://pkg.pr.new/@tanstack/svelte-db@1650@tanstack/tauri-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/tauri-db-sqlite-persistence@1650@tanstack/trailbase-db-collection
npm i https://pkg.pr.new/@tanstack/trailbase-db-collection@1650@tanstack/vue-db
npm i https://pkg.pr.new/@tanstack/vue-db@1650commit:
926faa0Size Change: 0 B
Total Size: 125 kB
compressed-size-action::db-package-sizeℹ️ View Unchanged
Filename Size packages/db/dist/esm/collection/change-events.js1.43 kB packages/db/dist/esm/collection/changes.js1.38 kB packages/db/dist/esm/collection/cleanup-queue.js810 B packages/db/dist/esm/collection/events.js434 B packages/db/dist/esm/collection/index.js3.62 kB packages/db/dist/esm/collection/indexes.js1.99 kB packages/db/dist/esm/collection/lifecycle.js1.69 kB packages/db/dist/esm/collection/mutations.js2.47 kB packages/db/dist/esm/collection/state.js5.4 kB packages/db/dist/esm/collection/subscription.js3.74 kB packages/db/dist/esm/collection/sync.js2.88 kB packages/db/dist/esm/collection/transaction-metadata.js144 B packages/db/dist/esm/deferred.js207 B packages/db/dist/esm/errors.js5.1 kB packages/db/dist/esm/event-emitter.js748 B packages/db/dist/esm/index.js3.1 kB packages/db/dist/esm/indexes/auto-index.js829 B packages/db/dist/esm/indexes/base-index.js767 B packages/db/dist/esm/indexes/basic-index.js2.06 kB packages/db/dist/esm/indexes/btree-index.js2.19 kB packages/db/dist/esm/indexes/index-registry.js820 B packages/db/dist/esm/indexes/reverse-index.js557 B packages/db/dist/esm/local-only.js916 B packages/db/dist/esm/local-storage.js2.12 kB packages/db/dist/esm/optimistic-action.js359 B packages/db/dist/esm/paced-mutations.js496 B packages/db/dist/esm/proxy.js3.75 kB packages/db/dist/esm/query/builder/functions.js1.47 kB packages/db/dist/esm/query/builder/index.js5.84 kB packages/db/dist/esm/query/builder/ref-proxy.js1.24 kB packages/db/dist/esm/query/compiler/evaluators.js1.89 kB packages/db/dist/esm/query/compiler/expressions.js430 B packages/db/dist/esm/query/compiler/group-by.js3.56 kB packages/db/dist/esm/query/compiler/index.js6.67 kB packages/db/dist/esm/query/compiler/joins.js2.5 kB packages/db/dist/esm/query/compiler/lazy-targets.js923 B packages/db/dist/esm/query/compiler/order-by.js1.74 kB packages/db/dist/esm/query/compiler/select.js1.53 kB packages/db/dist/esm/query/effect.js4.77 kB packages/db/dist/esm/query/expression-helpers.js1.43 kB packages/db/dist/esm/query/ir.js1.25 kB packages/db/dist/esm/query/live-query-collection.js360 B packages/db/dist/esm/query/live/collection-config-builder.js9.1 kB packages/db/dist/esm/query/live/collection-registry.js264 B packages/db/dist/esm/query/live/collection-subscriber.js1.93 kB packages/db/dist/esm/query/live/internal.js145 B packages/db/dist/esm/query/live/utils.js1.81 kB packages/db/dist/esm/query/optimizer.js2.92 kB packages/db/dist/esm/query/predicate-utils.js2.97 kB packages/db/dist/esm/query/query-once.js359 B packages/db/dist/esm/query/subset-dedupe.js960 B packages/db/dist/esm/scheduler.js1.3 kB packages/db/dist/esm/SortedMap.js1.3 kB packages/db/dist/esm/strategies/debounceStrategy.js247 B packages/db/dist/esm/strategies/queueStrategy.js428 B packages/db/dist/esm/strategies/throttleStrategy.js246 B packages/db/dist/esm/transactions.js3.04 kB packages/db/dist/esm/utils.js927 B packages/db/dist/esm/utils/array-utils.js273 B packages/db/dist/esm/utils/browser-polyfills.js304 B packages/db/dist/esm/utils/btree.js5.61 kB packages/db/dist/esm/utils/comparison.js1.11 kB packages/db/dist/esm/utils/cursor.js457 B packages/db/dist/esm/utils/index-optimization.js2.39 kB packages/db/dist/esm/utils/type-guards.js157 B packages/db/dist/esm/utils/uuid.js449 B packages/db/dist/esm/virtual-props.js360 B 📝 Walkthrough
Walkthrough#
Adds a benchmark runner for incremental-update scenarios, a comparison script for base versus candidate reports, and a GitHub Actions workflow that runs both on pull requests and manual dispatches, publishes artifacts, and updates a PR comment.
Changes#
Benchmark Suite
Layer / File(s) Summary Benchmark runner: types, CLI args, and query cases
scripts/bench/incremental-update.tsDefines fixture and result types, parses benchmark CLI options, and declares the live-query benchmark cases and write functions. Benchmark execution and fixture management
scripts/bench/incremental-update.tsRuns each benchmark case, builds manual-sync collections and fixtures, applies source indexes, performs mutation scenarios, and finalizes write cleanup. Statistics and report formatting
scripts/bench/incremental-update.tsComputes timing statistics, gathers runtime metadata, and formats the textual benchmark report output. Base/candidate comparison script
scripts/bench/compare-incremental-update.tsLoads benchmark reports, matches runs by composite key, classifies regressions and improvements, computes aggregate ratios, renders Markdown output, and parses comparison CLI options. CI workflow wiring
.github/workflows/benchmark.ymlAdds the Benchmark workflow, runs the benchmark on PR head and base commits, publishes comparison artifacts, and updates a PR comment. Estimated code review effort: 4 (Complex) | ~60 minutes
Sequence Diagram(s)#
sequenceDiagram participant GitHub as GitHub Actions participant Benchmark as benchmark.yml participant Runner as incremental-update.ts participant Compare as compare-incremental-update.ts participant PullRequest as PR comment GitHub->>Benchmark: trigger on PR or dispatch Benchmark->>Runner: generate candidate.json and base.json Benchmark->>Compare: generate comparison.md Benchmark->>PullRequest: post or update comment🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation Title check ✅ Passed The title clearly summarizes the new CI benchmark workflow comparing PRs against main. Description check ✅ Passed It describes the benchmark extraction, workflow, triggers, and validation, though it doesn't use the repo's exact template sections. Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. ✨ Finishing Touches
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch `kevin/perf-benchmark-ci`
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment `@coderabbitai help` to get the list of available commands.Size Change: 0 B
Total Size: 4.26 kB
compressed-size-action::react-db-package-sizeℹ️ View Unchanged
Filename Size packages/react-db/dist/esm/index.js249 B packages/react-db/dist/esm/useLiveInfiniteQuery.js1.32 kB packages/react-db/dist/esm/useLiveQuery.js1.37 kB packages/react-db/dist/esm/useLiveQueryEffect.js355 B packages/react-db/dist/esm/useLiveSuspenseQuery.js567 B packages/react-db/dist/esm/usePacedMutations.js401 B Actionable comments posted: 2
🧹 Nitpick comments (3)
scripts/bench/compare-incremental-update.ts (2)
97-108: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueKey joining without escaping risks collisions.
resultKeyconcatenates fields with|without any escaping or type prefixes. If any label/query string ever contains|, boundaries between fields shift and unrelated results could be matched incorrectly.As per coding guidelines, "When converting keys to strings, ensure no collisions by using proper encoding with type prefixes."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/bench/compare-incremental-update.ts` around lines 97 - 108, The resultKey helper is building a composite string key by joining raw RunResult fields with a plain delimiter, which can collide if any value contains that delimiter. Update resultKey to use a collision-safe encoding with explicit type prefixes or escaped/serialized fields so each RunResult property remains unambiguous, and keep the matching logic in compare-incremental-update.ts aligned with the new key format.Source: Coding guidelines
159-179: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueisRegression/isImprovementare near-duplicate logic.Both functions share the same significance check and only differ in ratio direction; could be collapsed into a single
classifyhelper returning'regression' | 'improvement' | 'none'to avoid recomputingisSignificanttwice per comparison informatMarkdown.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/bench/compare-incremental-update.ts` around lines 159 - 179, The isRegression and isImprovement helpers duplicate the same significance logic and cause isSignificant to be evaluated twice for each Comparison in formatMarkdown. Refactor the comparison classification in compare-incremental-update.ts into a single helper (for example, a classify-style function) that checks significance once and returns regression, improvement, or none based on medianRatio direction, then update formatMarkdown to use that shared result instead of calling both helpers separately..github/workflows/benchmark.yml (1)
22-28: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueConsider a job-level timeout.
No
timeout-minutesis set; a hungpnpm install/build/benchmark could occupy the runner up to GitHub's default (6h) before failing.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/benchmark.yml around lines 22 - 28, The benchmark job currently has no execution limit, so a hung install/build/benchmark can hold a runner until GitHub’s default timeout. Add a job-level timeout setting to the benchmark job in the workflow definition alongside the existing if/runs-on fields, using the benchmark job identifier to keep the limit explicit and prevent runaway runs.🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Inline comments: In `@scripts/bench/compare-incremental-update.ts`: - Around line 15-52: The local type copies in compare-incremental-update.ts are drifting from the shared incremental-update.ts contract, and sourceIndexMode/mutationMode have been widened to string. Replace the duplicated Summary, FixtureScale, RunResult, and Report definitions by importing the shared types from incremental-update.ts, or export them there if needed, so compare-incremental-update stays aligned with the canonical SourceIndexMode and MutationMode unions and preserves type safety. - Around line 204-296: The footer in formatMarkdown is incorrectly reading runtime data from the outer candidate closure instead of the candidateReport parameter, which breaks the function’s explicit data flow. Update the Runner line to use candidateReport.metadata for node, platform, and cpu so formatMarkdown depends only on its arguments and remains testable/reusable. Keep the rest of the function consistent with the existing use of baseReport and candidateReport. --- Nitpick comments: In @.github/workflows/benchmark.yml: - Around line 22-28: The benchmark job currently has no execution limit, so a hung install/build/benchmark can hold a runner until GitHub’s default timeout. Add a job-level timeout setting to the benchmark job in the workflow definition alongside the existing if/runs-on fields, using the benchmark job identifier to keep the limit explicit and prevent runaway runs. In `@scripts/bench/compare-incremental-update.ts`: - Around line 97-108: The resultKey helper is building a composite string key by joining raw RunResult fields with a plain delimiter, which can collide if any value contains that delimiter. Update resultKey to use a collision-safe encoding with explicit type prefixes or escaped/serialized fields so each RunResult property remains unambiguous, and keep the matching logic in compare-incremental-update.ts aligned with the new key format. - Around line 159-179: The isRegression and isImprovement helpers duplicate the same significance logic and cause isSignificant to be evaluated twice for each Comparison in formatMarkdown. Refactor the comparison classification in compare-incremental-update.ts into a single helper (for example, a classify-style function) that checks significance once and returns regression, improvement, or none based on medianRatio direction, then update formatMarkdown to use that shared result instead of calling both helpers separately.🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
db0f6f77-810d-4a17-a5e2-33d8c19ebc76📥 Commits
Reviewing files that changed from the base of the PR and between 3ec3e7ae1b2fa5ab9fee3ebaebb6d97c9487d29b and 4c1de9506159ebd2bb8df2e20781cbe48bd67e82.
📒 Files selected for processing (3)
.github/workflows/benchmark.ymlscripts/bench/compare-incremental-update.tsscripts/bench/incremental-update.ts
@@ -0,0 +32,21 @@32+type RunResult = {33+ query: string34+ scenario: string35+ scale: FixtureScale36+ sourceIndexMode: string37+ mutationMode: string38+ coldHydrateMs: number39+ writeSummary: Summary40+}41+42+type Report = {43+ metadata: {44+ node: string45+ platform: string46+ cpu: string47+ gitSha: string48+ iterations: number49+ warmup: number50+ }51+ results: Array<RunResult>52+}📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Duplicated types drift from the upstream contract.
Summary,FixtureScale, andRunResultare copy-pasted fromscripts/bench/incremental-update.ts. Worse,sourceIndexMode/mutationModeare widened here tostringinstead of theSourceIndexMode/MutationModeliteral unions used upstream (per the shared contract inincremental-update.ts:85-121), so this file loses type safety and both copies can silently diverge as the runner evolves.Consider exporting the shared types from
incremental-update.tsand importing them here.As per coding guidelines, "Extract common logic into utility functions when identical or near-identical code blocks appear in multiple places."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/bench/compare-incremental-update.ts` around lines 15 - 52, The local type copies in compare-incremental-update.ts are drifting from the shared incremental-update.ts contract, and sourceIndexMode/mutationMode have been widened to string. Replace the duplicated Summary, FixtureScale, RunResult, and Report definitions by importing the shared types from incremental-update.ts, or export them there if needed, so compare-incremental-update stays aligned with the canonical SourceIndexMode and MutationMode unions and preserves type safety.Source: Coding guidelines
@@ -0,0 +276,21 @@276+ comparison.medianRatio,277+ )} | ${formatMs(comparison.base.writeSummary.p95Ms)} | ${formatMs(278+ comparison.candidate.writeSummary.p95Ms,279+ )} | ${formatDelta(comparison.p95Ratio)} | ${marker(280+ comparison,281+ threshold,282+ )} |`,283+ )284+ }285+ lines.push(``)286+ lines.push(`</details>`)287+ lines.push(``)288+ }289+290+ lines.push(291+ `<sub>Runner: node ${candidate.metadata.node}, ${candidate.metadata.platform}, ${candidate.metadata.cpu}. ` +292+ `Timings on shared CI runners are noisy; treat small deltas as indicative only.</sub>`,293+ )294+295+ return lines.join(`\n`)296+}📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Uses closure variable
candidateinstead of thecandidateReportparameter.Lines 290-293 reference the top-level
candidatevariable rather than thecandidateReportparameter that the rest of the function correctly uses (e.g. lines 221-224). It happens to work today because they point to the same object, but it breaks the function's parameter contract and hurts testability if this function is ever reused/tested independently.As per coding guidelines, "Prefer explicit function parameters over closures to improve testability and clarify data flow dependencies."
♻️ Proposed fix
lines.push( - `<sub>Runner: node ${candidate.metadata.node}, ${candidate.metadata.platform}, ${candidate.metadata.cpu}. ` + + `<sub>Runner: node ${candidateReport.metadata.node}, ${candidateReport.metadata.platform}, ${candidateReport.metadata.cpu}. ` + `Timings on shared CI runners are noisy; treat small deltas as indicative only.</sub>`, )📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Suggested change204+ lines.push(205+ `<sub>Runner: node ${candidateReport.metadata.node}, ${candidateReport.metadata.platform}, ${candidateReport.metadata.cpu}. ` +206+ `Timings on shared CI runners are noisy; treat small deltas as indicative only.</sub>`,207+ )🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/bench/compare-incremental-update.ts` around lines 204 - 296, The footer in formatMarkdown is incorrectly reading runtime data from the outer candidate closure instead of the candidateReport parameter, which breaks the function’s explicit data flow. Update the Runner line to use candidateReport.metadata for node, platform, and cpu so formatMarkdown depends only on its arguments and remains testable/reusable. Keep the rest of the function consistent with the existing use of baseReport and candidateReport.Source: Coding guidelines
⚠️ No Changeset found#
Latest commit: 926faa0c1a882a9d0a23be6a29cc073037ac19dc
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
I merged
maininto this branch (a normal merge, no conflicts). The benchmark and compare scripts run unchanged on today'smain. A smoke run of the full matrix passes, and a same-code comparison reports 1.00×.Against your July baseline, the suite shows
mainis now slower in three places:- Ordered + limit, add/remove pair: about 12× slower. This started with #1896.
- Cold hydrate of a join with no index, 10k rows: about 22× slower. This started with #1740.
- Steady-state writes: about 1.5× slower by geomean. This started with #1797, then drifted further.
Fixes for these will follow as separate PRs. This workflow will show their before-and-after numbers.
This pull request comment was written by Isaac.
Size Change: 0 B
Total Size: 190 kB
compressed-size-action::db-and-react-package-sizeℹ️ View Unchanged
Filename Size packages/db/dist/esm/client.js3.61 kB packages/db/dist/esm/collection-options.js236 B packages/db/dist/esm/collection/change-events.js1.64 kB packages/db/dist/esm/collection/changes.js2.38 kB packages/db/dist/esm/collection/cleanup-queue.js808 B packages/db/dist/esm/collection/config-errors.js547 B packages/db/dist/esm/collection/events.js481 B packages/db/dist/esm/collection/index.js4.66 kB packages/db/dist/esm/collection/indexes.js2.06 kB packages/db/dist/esm/collection/lifecycle.js2.82 kB packages/db/dist/esm/collection/mutations.js2.96 kB packages/db/dist/esm/collection/state.js6.9 kB packages/db/dist/esm/collection/subscription.js8.44 kB packages/db/dist/esm/collection/sync.js5.2 kB packages/db/dist/esm/collection/validate-config.js1.11 kB packages/db/dist/esm/deferred.js207 B packages/db/dist/esm/errors.js5.67 kB packages/db/dist/esm/event-emitter.js961 B packages/db/dist/esm/index.js4.08 kB packages/db/dist/esm/indexes/auto-index.js841 B packages/db/dist/esm/indexes/base-index.js1.25 kB packages/db/dist/esm/indexes/basic-index.js2.01 kB packages/db/dist/esm/indexes/btree-index.js2.3 kB packages/db/dist/esm/indexes/index-registry.js820 B packages/db/dist/esm/indexes/reverse-index.js370 B packages/db/dist/esm/live-query-adapter.js338 B packages/db/dist/esm/live-query-observer.js4.6 kB packages/db/dist/esm/live-query-options.js1.06 kB packages/db/dist/esm/live-query-window-controller.js4.13 kB packages/db/dist/esm/local-only.js1.08 kB packages/db/dist/esm/local-storage.js2.18 kB packages/db/dist/esm/optimistic-action.js359 B packages/db/dist/esm/paced-mutations.js702 B packages/db/dist/esm/persisted-readiness.js195 B packages/db/dist/esm/proxy.js3.17 kB packages/db/dist/esm/query/builder/clone-query.js766 B packages/db/dist/esm/query/builder/functions.js1.45 kB packages/db/dist/esm/query/builder/index.js6.75 kB packages/db/dist/esm/query/builder/query-ir.js116 B packages/db/dist/esm/query/builder/ref-proxy-identity.js292 B packages/db/dist/esm/query/builder/ref-proxy.js1.48 kB packages/db/dist/esm/query/builder/wrapper-identity.js221 B packages/db/dist/esm/query/compiler/evaluators.js2.1 kB packages/db/dist/esm/query/compiler/expressions.js604 B packages/db/dist/esm/query/compiler/group-by.js4.2 kB packages/db/dist/esm/query/compiler/index.js9.39 kB packages/db/dist/esm/query/compiler/joins.js3.2 kB packages/db/dist/esm/query/compiler/lazy-targets.js1.14 kB packages/db/dist/esm/query/compiler/order-by.js2 kB packages/db/dist/esm/query/compiler/parent-routes.js319 B packages/db/dist/esm/query/compiler/query-equivalence.js448 B packages/db/dist/esm/query/compiler/route-metadata.js1.24 kB packages/db/dist/esm/query/compiler/select.js1.59 kB packages/db/dist/esm/query/effect.js4.86 kB packages/db/dist/esm/query/equality-conjunct.js486 B packages/db/dist/esm/query/equality-value-identity.js591 B packages/db/dist/esm/query/expression-helpers.js1.45 kB packages/db/dist/esm/query/ir-stable-identity.js4.2 kB packages/db/dist/esm/query/ir.js1.7 kB packages/db/dist/esm/query/join-conditions.js257 B packages/db/dist/esm/query/live-query-collection.js391 B packages/db/dist/esm/query/live/bucket-facade-adapter.js2.67 kB packages/db/dist/esm/query/live/collection-config-builder.js6.47 kB packages/db/dist/esm/query/live/collection-registry.js264 B packages/db/dist/esm/query/live/collection-subscriber.js2.05 kB packages/db/dist/esm/query/live/graph-scheduler.js305 B packages/db/dist/esm/query/live/internal.js145 B packages/db/dist/esm/query/live/materialized-pipeline.js2.32 kB packages/db/dist/esm/query/live/ordered-source-loader.js4.14 kB packages/db/dist/esm/query/live/subset-demand-controller.js1.65 kB packages/db/dist/esm/query/live/utils.js1.2 kB packages/db/dist/esm/query/optimizer.js2.91 kB packages/db/dist/esm/query/pooled-live-query.js4.06 kB packages/db/dist/esm/query/query-once.js359 B packages/db/dist/esm/query/runtime-reference-identity.js630 B packages/db/dist/esm/query/subset-dedupe.js493 B packages/db/dist/esm/scheduler.js1.13 kB packages/db/dist/esm/SortedMap.js1.6 kB packages/db/dist/esm/strategies/debounceStrategy.js331 B packages/db/dist/esm/strategies/queueStrategy.js488 B packages/db/dist/esm/strategies/throttleStrategy.js386 B packages/db/dist/esm/sync-persistence.js540 B packages/db/dist/esm/sync-receipt.js211 B packages/db/dist/esm/transactions.js3.89 kB packages/db/dist/esm/utils.js1.49 kB packages/db/dist/esm/utils/array-utils.js270 B packages/db/dist/esm/utils/browser-polyfills.js304 B packages/db/dist/esm/utils/btree.js3.02 kB packages/db/dist/esm/utils/callbacks.js174 B packages/db/dist/esm/utils/comparison.js1.59 kB packages/db/dist/esm/utils/cursor.js677 B packages/db/dist/esm/utils/error.js167 B packages/db/dist/esm/utils/get-or-create.js155 B packages/db/dist/esm/utils/index-optimization.js2.42 kB packages/db/dist/esm/utils/source-record.js140 B packages/db/dist/esm/utils/type-guards.js230 B packages/db/dist/esm/utils/uuid.js449 B packages/db/dist/esm/virtual-props.js413 B packages/react-db/dist/esm/DbProvider.js317 B packages/react-db/dist/esm/development.js190 B packages/react-db/dist/esm/HydrationBoundary.js263 B packages/react-db/dist/esm/index.js330 B packages/react-db/dist/esm/live-query-internals.js282 B packages/react-db/dist/esm/useLiveInfiniteQuery.js1.94 kB packages/react-db/dist/esm/useLiveQuery.js3.6 kB packages/react-db/dist/esm/useLiveQueryEffect.js355 B packages/react-db/dist/esm/useLiveSuspenseQuery.js1.33 kB packages/react-db/dist/esm/usePacedMutations.js401 B KyleAMathews merged this65992aa
KyleAMathews closed this
Sign in to join this conversation.
Incremental update benchmark#
Comparing
b3988488(this PR) againstde8d0f1b(base). Times are per-write medians over 100 iterations (20 warmup writes).1 regression(s), 1 improvement(s) (threshold: ±20% and >0.05ms).
Overall median write time vs base: 1.01× (geometric mean of per-case ratios; lower is faster).
Each row aggregates the 12 scale/index/write-mode configurations of that query; per-configuration tables below.
100 rows/collection | source indexes: none | synced writes — geomean 1.08×
100 rows/collection | source indexes: none | optimistic writes — geomean 1.09×
100 rows/collection | source indexes: manual | synced writes — geomean 0.94×
100 rows/collection | source indexes: manual | optimistic writes — geomean 0.90×
1,000 rows/collection | source indexes: none | synced writes — geomean 1.05×
1,000 rows/collection | source indexes: none | optimistic writes — geomean 0.96×
1,000 rows/collection | source indexes: manual | synced writes — geomean 1.02×
1,000 rows/collection | source indexes: manual | optimistic writes — geomean 1.06×
10,000 rows/collection | source indexes: none | synced writes — geomean 1.07×
10,000 rows/collection | source indexes: none | optimistic writes — geomean 1.01×
10,000 rows/collection | source indexes: manual | synced writes — geomean 1.24×, 1 change(s)
10,000 rows/collection | source indexes: manual | optimistic writes — geomean 0.81×, 1 change(s)