Skip to content

perf(fmt): optimize cache serialization - #341

Merged
chenjiahan merged 5 commits into
mainfrom
chenjiahan/feat-fmt-cache-format
Aug 13, 2026
Merged

perf(fmt): optimize cache serialization#341
chenjiahan merged 5 commits into
mainfrom
chenjiahan/feat-fmt-cache-format

Conversation

@chenjiahan

@chenjiahan chenjiahan commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

rs fmt currently repeats object keys, option hashes, state strings, and full SHA-256 digests for every cached file, increasing cache I/O and JSON overhead in large repositories.

This PR introduces a version 2 flat cache format with interned option hashes, numeric states, and 96-bit base64url SHA-256 tokens while retaining top-level schema checks and atomic persistence.

In an rsbuild repository benchmark, cache size decreased by 62% and JSON parse/stringify time by about 60%.

@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: da5f3bd
Status: ✅  Deploy successful!
Preview URL: https://0f56dcae.rstack-cli.pages.dev
Branch Preview URL: https://chenjiahan-feat-fmt-cache-fo.rstack-cli.pages.dev

View logs

@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: dc604f3cbe

ℹ️ 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/cacheStore.ts
@chenjiahan
chenjiahan merged commit 11c56cd into main Aug 13, 2026
5 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/feat-fmt-cache-format branch August 13, 2026 04:53
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