Skip to content

perf(fmt): disable fsync for atomic writes - #141

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/perf-fmt-disable-fsync
Aug 3, 2026
Merged

perf(fmt): disable fsync for atomic writes#141
chenjiahan merged 1 commit into
mainfrom
chenjiahan/perf-fmt-disable-fsync

Conversation

@chenjiahan

@chenjiahan chenjiahan commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

Per-file fsync dominates rs fmt parallel write time for large repositories even though formatter output can be regenerated.

This disables fsync for atomically writes while preserving temporary-file and rename-based atomic replacement, and adds a regression assertion for the write options.

The tradeoff is weaker durability if the OS crashes or loses power immediately after formatting; on the Outline fixture (2,516 files, 2,374 rewritten), parallel formatting on an M3 Max improved from approximately 12.7s to 2.2s.

Related Links

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1e854fe
Status: ✅  Deploy successful!
Preview URL: https://38dd5807.rstack-cli.pages.dev
Branch Preview URL: https://chenjiahan-perf-fmt-disable.rstack-cli.pages.dev

View logs

@chenjiahan
chenjiahan force-pushed the chenjiahan/perf-fmt-disable-fsync branch from f0c27d1 to 1e854fe Compare August 3, 2026 03:44
@chenjiahan
chenjiahan merged commit 6062b4a into main Aug 3, 2026
4 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/perf-fmt-disable-fsync branch August 3, 2026 03:46
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.

1 participant