hyperium / http

Rust HTTP types
Apache License 2.0
1.12k stars 283 forks source link

feat: Allow unicode in uri #565

Closed Xuanwo closed 1 year ago

Xuanwo commented 1 year ago

Signed-off-by: Xuanwo github@xuanwo.io

Fix https://github.com/hyperium/http/issues/259

Bench

Before

test uri_parse_relative_medium ... bench:         128 ns/iter (+/- 12) = 468 MB/s
test uri_parse_relative_query  ... bench:         169 ns/iter (+/- 15) = 497 MB/s
test uri_parse_slash           ... bench:          32 ns/iter (+/- 0) = 31 MB/s
test uri_parse_full_query      missing, not supported

After

test uri_parse_relative_medium ... bench:         153 ns/iter (+/- 4) = 392 MB/s
test uri_parse_relative_query  ... bench:         174 ns/iter (+/- 1) = 482 MB/s
test uri_parse_slash           ... bench:          28 ns/iter (+/- 0) = 35 MB/s
test uri_parse_full_query      ... bench:         293 ns/iter (+/- 15) = 293 MB/s

Our bench doesn't have authority, so those bench can't reflect the real perf