Open Wonshtrum opened 1 month ago
Related note even if it doesn't impact performances noticeably, the port is still separated from the authority on the Sozu size rather than kawa's. It is also done redundantly and with two different methods: once in frontend_from_request
with hostname_and_port
and once in log_request
with split_once
.
Some recent analysis of flame graphs and call graphs have revealed some inefficiencies that could be greatly improved:
editor::HttpContext::on_headers
can take up to 75% of theHttp::readable
time and 30% ofHttp::backend_readable
, mainly due to expensive formatsKawa::as_io_slice
is up to 3 times slower thanKawa::prepare
and takes up to 60% ofHttp::backend_writable
time and 25% ofHttp::writable
due to a Vec allocationfmt::Display
of certain structs seems really expensive, taking up to 23% of total runtime (I don't know if we can avoid it, most structs come from std likeSocketAddr
)It also revealed some broader problems. Here are the ones that stand out with the percentage of total time execution in an highly optimized build with no logs nor access logs: