Skip to content

perf(core): avoid splitting content types in gzip middleware - #8881

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/perf-mime-type-prefix
Nov 16, 2026
Merged

chenjiahan merged 1 commit into
mainfrom
chenjiahan/perf-mime-type-prefix

Conversation

@chenjiahan

@chenjiahan chenjiahan commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Motivation

Avoid allocating an array to extract the MIME type during gzip response checks.

Changes

Slice at the first semicolon while preserving whitespace trimming and case normalization.

Local helper benchmark (mixed MIME types with and without parameters; Node 24.19.0, Apple M5 Max; medians from 3 processes × 11 warmed A/B rounds).

Before After Speedup
50.6 ns/call 27.4 ns/call 84.2% faster

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T11:33:30.903101Z 0e0ddd2 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chenjiahan
chenjiahan merged commit 4c830eb into main Nov 16, 2026
8 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/perf-mime-type-prefix branch November 16, 2026 02:14
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