Skip to content

Skip wrapper scans for unwrapped types in typed validation - #392

Open
EfeDurmaz16 wants to merge 1 commit into
laravel:0.xfrom
EfeDurmaz16:skip-wrapper-scans
Open

EfeDurmaz16 wants to merge 1 commit into
laravel:0.xfrom
EfeDurmaz16:skip-wrapper-scans

Conversation

@EfeDurmaz16

Copy link
Copy Markdown

is_wrapped_target was checking all 13 wrapper prefixes even for plain types like String, u32 and Uuid. Each check also looked for < in the wrapper name.

We can skip those checks entirely if the type name doesn't end in >. This doesn't change behavior since peel_prefix already requires that suffix.

I measured 21–27% lower thread CPU time per Valid<T> request across two separate benchmark runs (release build, test client, interleaved runs). Allocations stayed the same.

is_wrapped_target tried 13 wrapper prefixes against the type name of
every decoded value, and each try searched the wrapper's own name for
its '<'. A name that does not end in '>' cannot match any of them, so
return before the scans. peel_prefix already required the '>' suffix,
so the result is the same for every type.

Thread CPU time per Valid<T> request through the test client, release
build, interleaved runs: 21% to 27% lower in two separate runs.
Allocations per request are unchanged.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 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-12-01T21:13:29.928023Z e300596 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.

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