Reduce typed app-server request serialization overhead (#34766)

## What changed

- Use `ClientRequest::method_name()` directly when preparing typed request
  diagnostics for in-process and remote clients.
- Allocate the owned method name only when constructing an error.
- Remove the serialization-based method lookup and the redundant allocating
  `ClientRequest::method()` helper.

GitOrigin-RevId: 93859e512a4f20204e0db4f929a2baebe4374ec5
This commit is contained in:
jif
2026-07-22 14:50:13 +00:00
committed by copyberry
parent 64dc1c7a01
commit e370d23691
3 changed files with 28 additions and 42 deletions
@@ -239,10 +239,6 @@ macro_rules! client_request_definitions {
}
}
pub fn method(&self) -> String {
self.method_name().to_string()
}
pub fn serialization_scope(&self) -> Option<ClientRequestSerializationScope> {
match self {
$(
@@ -2671,7 +2667,6 @@ mod tests {
params: None,
};
assert_eq!(request.id(), &RequestId::Integer(1));
assert_eq!(request.method(), "account/rateLimits/read");
assert_eq!(
json!({
"method": "account/rateLimits/read",
@@ -2689,7 +2684,6 @@ mod tests {
params: None,
};
assert_eq!(request.id(), &RequestId::Integer(1));
assert_eq!(request.method(), "account/usage/read");
assert_eq!(
json!({
"method": "account/usage/read",
@@ -2707,7 +2701,6 @@ mod tests {
params: None,
};
assert_eq!(request.id(), &RequestId::Integer(1));
assert_eq!(request.method(), "account/workspaceMessages/read");
assert_eq!(
json!({
"method": "account/workspaceMessages/read",