Skip to content

perf(fmt): use synchronous file I/O in workers - #142

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/perf-fmt-direct-write
Aug 3, 2026
Merged

perf(fmt): use synchronous file I/O in workers#142
chenjiahan merged 1 commit into
mainfrom
chenjiahan/perf-fmt-direct-write

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Summary

This replaces atomically with synchronous node:fs reads and writes inside dedicated formatting workers, avoiding libuv scheduling and atomic replacement overhead. On the Outline benchmark (2,516 files, 2,374 changed), mean wall time improved by 12.4% with 15 workers and 22.6% with 8 workers compared with atomically using fsync: false.

Writes are no longer crash-safe atomic replacements; formatting output is reproducible, and each synchronous operation blocks only its own worker. The unused atomic-write dependencies and notices are removed, and the tests now cover native file-system write failures.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 18fcabd
Status: ✅  Deploy successful!
Preview URL: https://270c6116.rstack-cli.pages.dev
Branch Preview URL: https://chenjiahan-perf-fmt-direct-w.rstack-cli.pages.dev

View logs

@chenjiahan
chenjiahan merged commit a3ef9f9 into main Aug 3, 2026
4 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/perf-fmt-direct-write branch August 3, 2026 05:03

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18fcabdb6b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rstack/src/fmt/worker.ts
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