1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 15:49:44 -05:00

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`
This commit is contained in:
Aaron O'Mullan 2021-08-15 12:25:16 +02:00 committed by GitHub
parent 2d578ea54a
commit 18ff6bb053
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(