Skip to content

[runtime/utils/buffer/write] use Blob::write_at_sync#3852

Merged
patrick-ogrady merged 7 commits into
mainfrom
andre/runtime-buffer-write-at-sync
May 22, 2026
Merged

[runtime/utils/buffer/write] use Blob::write_at_sync#3852
patrick-ogrady merged 7 commits into
mainfrom
andre/runtime-buffer-write-at-sync

Conversation

@andresilva
Copy link
Copy Markdown
Member

This PR updates buffered Write to use Blob::write_at_sync when sync only needs to persist the currently buffered tip.

Write now keeps durability state alongside the tip buffer to track whether a prior plain write_at or resize requires a full Blob::sync. If no such mutation happened, sync can persist the buffered range directly (with Blob::write_at_sync), otherwise it falls back to a full sync.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 21, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
commonware-mcp a569edb May 22 2026, 07:45 PM

@andresilva andresilva changed the title [runtime/utils/buffer/write] optimistically use Blob::write_at_sync [runtime/utils/buffer/write] use Blob::write_at_sync May 21, 2026
@andresilva andresilva self-assigned this May 21, 2026
@andresilva andresilva moved this to Ready for Review in Tracker May 21, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

Benchmark results

Tip

PASSED: No benchmark exceeded the regression threshold.

Benchmark comparison table
Benchmark Baseline (main) Current Delta Threshold Status
qmdb::merkleize/variant=any::unordered::fixed::mmr keys=10000 ch=false sync=false 1.577 ms 1.565 ms -0.74% 10.00% ✅ PASS
qmdb::merkleize/variant=current::ordered::fixed::mmb chunk=256 keys=10000 ch=true sync=false 3.085 ms 3.042 ms -1.41% 10.00% ✅ PASS

Baseline commit(s): 527763b5f80a

@andresilva andresilva requested a review from patrick-ogrady May 21, 2026 15:05
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 21, 2026

Deploying monorepo with  Cloudflare Pages  Cloudflare Pages

Latest commit: a569edb
Status: ✅  Deploy successful!
Preview URL: https://33b1a109.monorepo-eu0.pages.dev
Branch Preview URL: https://andre-runtime-buffer-write-a.monorepo-eu0.pages.dev

View logs

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 858babd. Configure here.

Comment thread runtime/src/utils/buffer/write.rs Outdated
Comment thread runtime/src/utils/buffer/write.rs Outdated
Comment thread runtime/src/utils/buffer/write.rs
Comment thread runtime/src/utils/buffer/write.rs
Comment thread runtime/src/utils/buffer/write.rs
Comment thread runtime/src/utils/buffer/write.rs Outdated
@patrick-ogrady patrick-ogrady merged commit 3c08216 into main May 22, 2026
176 checks passed
@patrick-ogrady patrick-ogrady deleted the andre/runtime-buffer-write-at-sync branch May 22, 2026 19:55
@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in Tracker May 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

❌ Patch coverage is 89.37198% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.76%. Comparing base (d8589a0) to head (a569edb).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
runtime/src/utils/buffer/mod.rs 86.30% 19 Missing and 1 partial ⚠️
runtime/src/utils/buffer/write.rs 96.72% 1 Missing and 1 partial ⚠️
@@            Coverage Diff             @@
##             main    #3852      +/-   ##
==========================================
- Coverage   95.77%   95.76%   -0.02%     
==========================================
  Files         486      486              
  Lines      200338   200864     +526     
  Branches     4858     4861       +3     
==========================================
+ Hits       191871   192349     +478     
- Misses       6833     6882      +49     
+ Partials     1634     1633       -1     
Files with missing lines Coverage Δ
runtime/src/utils/buffer/write.rs 98.44% <96.72%> (+0.64%) ⬆️
runtime/src/utils/buffer/mod.rs 95.34% <86.30%> (-1.66%) ⬇️

... and 47 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8589a0...a569edb. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants