diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-08-15 12:25:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-15 12:25:16 +0200 |
commit | 18ff6bb053d600c277613628a256fe5fdd4dda67 (patch) | |
tree | f8594625f44b117a1ffafa533133550bdfea9195 | |
parent | 2d578ea54abe1da94d485d5abd501143ee225b96 (diff) |
perf(ext/http): faster req_url string assembly (#11711)
This stood out on a flamegraph, it took up ~1% of a profiled loadtest of `cli/bench/deno_http_native.js`
-rw-r--r-- | ext/http/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/http/lib.rs b/ext/http/lib.rs index add4e259f..eac09a1ec 100644 --- a/ext/http/lib.rs +++ b/ext/http/lib.rs @@ -283,7 +283,7 @@ fn req_url( Cow::Owned(addr.to_string()) }; let path = req.uri().path_and_query().map_or("/", |p| p.as_str()); - Ok(format!("{}://{}{}", scheme, host, path)) + Ok([scheme, "://", &host, path].concat()) } fn req_headers( |