Skip to content

Commit

Permalink
refactor(http1): adjust a few tracing event outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Oct 14, 2021
1 parent 55a61c0 commit e48519a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/proto/h1/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ where
match Pin::new(&mut self.io).poll_read(cx, &mut buf) {
Poll::Ready(Ok(_)) => {
let n = buf.filled().len();
trace!("received {} bytes", n);
unsafe {
// Safety: we just read that many bytes into the
// uninitialized part of the buffer, so this is okay.
Expand Down
13 changes: 2 additions & 11 deletions src/proto/h1/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,7 @@ impl Http1Transaction for Server {
/* SAFETY: it is safe to go from MaybeUninit array to array of MaybeUninit */
let mut headers: [MaybeUninit<httparse::Header<'_>>; MAX_HEADERS] =
unsafe { MaybeUninit::uninit().assume_init() };
trace!(
"Request.parse([Header; {}], [u8; {}])",
headers.len(),
buf.len()
);
trace!(bytes = buf.len(), "Request.parse");
let mut req = httparse::Request::new(&mut []);
let bytes = buf.as_ref();
match req.parse_with_uninit_headers(bytes, &mut headers) {
Expand All @@ -144,7 +140,6 @@ impl Http1Transaction for Server {
is_http_11 = false;
Version::HTTP_10
};
trace!("headers: {:?}", &req.headers);

record_header_indices(bytes, &req.headers, &mut headers_indices)?;
headers_len = req.headers.len();
Expand Down Expand Up @@ -879,11 +874,7 @@ impl Http1Transaction for Client {
// SAFETY: We can go safely from MaybeUninit array to array of MaybeUninit
let mut headers: [MaybeUninit<httparse::Header<'_>>; MAX_HEADERS] =
unsafe { MaybeUninit::uninit().assume_init() };
trace!(
"Response.parse([Header; {}], [u8; {}])",
headers.len(),
buf.len()
);
trace!(bytes = buf.len(), "Response.parse");
let mut res = httparse::Response::new(&mut []);
let bytes = buf.as_ref();
match ctx.h1_parser_config.parse_response_with_uninit_headers(
Expand Down

1 comment on commit e48519a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'end_to_end'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: e48519a Previous: 55a61c0 Ratio
http2_parallel_x10_req_10kb_100_chunks_adaptive_window 20559437 ns/iter (± 9922163) 9316121 ns/iter (± 10011532) 2.21

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.