Skip to content

perf(fmt): avoid decoding cache hits - #236

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/perf-fmt-cache-hit-decode
Aug 7, 2026
Merged

perf(fmt): avoid decoding cache hits#236
chenjiahan merged 1 commit into
mainfrom
chenjiahan/perf-fmt-cache-hit-decode

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

This PR avoids decoding formatter input when a content-cache entry already matches.

The worker now keeps the source as a Buffer while hashing cached content and only decodes it to UTF-8 when formatting is actually required. This removes an allocation and full-file UTF-8 scan from rs fmt cache hits without changing cache semantics.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 931092e
Status: ✅  Deploy successful!
Preview URL: https://5a84dfa3.rstack-cli.pages.dev
Branch Preview URL: https://chenjiahan-perf-fmt-cache-hi.rstack-cli.pages.dev

View logs

@chenjiahan
chenjiahan merged commit a01779f into main Aug 7, 2026
4 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/perf-fmt-cache-hit-decode branch August 7, 2026 13:12
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