seanmonstar / httparse

A push parser for the HTTP 1.x protocol in Rust.
https://docs.rs/httparse
Apache License 2.0
584 stars 114 forks source link

simd: drop 2 unnecessary instructions #137

Closed AaronO closed 1 year ago

AaronO commented 1 year ago

Benches

before:
test header/value_256b ... bench:          34 ns/iter (+/- 13)
test header/value_512b ... bench:          50 ns/iter (+/- 5)
test header/value_1024b ... bench:          86 ns/iter (+/- 7)
test header/value_2048b ... bench:         172 ns/iter (+/- 20)
test header/value_4096b ... bench:         298 ns/iter (+/- 62)

after:
test header/value_256b ... bench:          33 ns/iter (+/- 10)
test header/value_512b ... bench:          48 ns/iter (+/- 20)
test header/value_1024b ... bench:          77 ns/iter (+/- 8)
test header/value_2048b ... bench:         149 ns/iter (+/- 8)
test header/value_4096b ... bench:         252 ns/iter (+/- 50)
seanmonstar commented 1 year ago

MSRV, currently 1.32, is grumpy. Looks like this needs Rust 1.46, which came out in August 2020, almost 3 years ago.

Distros are on newer versions already. 👍

AaronO commented 1 year ago

MSRV, currently 1.32, is grumpy. Looks like this needs Rust 1.46, which came out in August 2020, almost 3 years ago.

Distros are on newer versions already. 👍

I think an MSRV bump would be reasonable, especially since hyper@master is on 1.56, but since we've managed without it so far we could mint this first series of perf changes in a release then bump MSRV and land this + other cleanups it enables. Bumping to 1.46 would allow for some slightly more idiomatic code in swar and other areas.

seanmonstar commented 1 year ago

I would probably make the next release a minor version anyways, 1.9, since the addition of neon at least feels significant enough to not be a patch version. I'd be fine with an MSRV bump in 1.9, or we could do it in 1.10...