hyperium / http

Rust HTTP types
Apache License 2.0
1.14k stars 284 forks source link

Enable simpler header name parser in debug builds #521

Closed ibraheemdev closed 2 years ago

ibraheemdev commented 2 years ago

This shaves close to a second off debug builds on my machine.

hawkw commented 2 years ago

If we're going to do this, it seems like it might also be a good idea to add a CI step to run the tests in release mode? Otherwsie, most of the parser code is no longer tested on CI.

seanmonstar commented 2 years ago

Maybe I'm misunderstanding... Seems this is turning off the debug assertions?

ibraheemdev commented 2 years ago

It makes it so the simpler version of parse_hdr in any debug builds, instead of only in WASM debug builds. debug_assertions is the cfg flag that identifies a debug build (ish).

seanmonstar commented 2 years ago

I'd normally think in a debug build we'd want the extra checks.

jeddenlea commented 2 years ago

https://github.com/hyperium/http/pull/499 removes the eq macro in all cases.

ibraheemdev commented 2 years ago

Closing in favor of #499.