-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
header.go Referer() optimize (#1313)
* args.go GetBool(): use switch with string casting This should be optimized by Go compiler itself so the b2s() call is not needed. It was previously done by this but changed in 1e7885e * header.go Referer() optimize Use direct peekArgBytes() instead of PeekBytes() that will check for special headers * header_timing_test.go BenchmarkRequestHeaderPeekBytesSpecialHeader The old BenchmarkRequestHeaderPeekBytesCanonical and BenchmarkRequestHeaderPeekBytesNonCanonical are in fact just measured the header normalization. But it's anyway is benchmarked separately. Results was almost the same: 1.5 ns/op. Instead, let's reuse the benches to find a difference between peeking of special (Host, CT) and custom headers.
- Loading branch information
Showing
3 changed files
with
41 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters