summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-08-15 12:25:16 +0200
committerGitHub <noreply@github.com>2021-08-15 12:25:16 +0200
commit18ff6bb053d600c277613628a256fe5fdd4dda67 (patch)
treef8594625f44b117a1ffafa533133550bdfea9195
parent2d578ea54abe1da94d485d5abd501143ee225b96 (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.rs2
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(