From e300596e9e14930808867f4f4e1adbff55a8425c Mon Sep 17 00:00:00 2001 From: EfeDurmaz16 Date: Tue, 1 Dec 2026 22:44:28 +0300 Subject: [PATCH] Skip wrapper scans for unwrapped types in typed validation 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 request through the test client, release build, interleaved runs: 21% to 27% lower in two separate runs. Allocations per request are unchanged. --- crates/http/src/validation/typed.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/http/src/validation/typed.rs b/crates/http/src/validation/typed.rs index 2c07dc296..204a57a92 100644 --- a/crates/http/src/validation/typed.rs +++ b/crates/http/src/validation/typed.rs @@ -163,6 +163,9 @@ fn is_wrapped_target(target: &str) -> bool { if name == target { return true; } + if !name.ends_with('>') { + return false; + } if let Some(inner) = peel_prefix(name, std::any::type_name::>()) .or_else(|| peel_prefix(name, std::any::type_name::>())) .or_else(|| peel_prefix(name, std::any::type_name::>()))