hyperium / h2

HTTP 2.0 client & server implementation for Rust.
MIT License
1.34k stars 269 forks source link

use HeaderName::from_static in Send::check_headers #675

Open srijs opened 1 year ago

srijs commented 1 year ago

Prevents parsing the header names (due to the AsHeaderName impl on &str) over and over again at runtime. It's just a small optimization in my case (sub-1% cpu time) but given the simplicity of the change seemed worth making in any case.

srijs commented 1 year ago

@hawkw thanks for the quick approve! I updated the branch based on the failed build, but looks like this needs another approval to re-run the tests?

hawkw commented 1 year ago

re-approved, hopefully everything passes this time!