From 18ff6bb053d600c277613628a256fe5fdd4dda67 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Sun, 15 Aug 2021 12:25:16 +0200 Subject: 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` --- ext/http/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') 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( -- cgit v1.2.3