-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use HTTP::Headers::Fast #496
Conversation
HTTP::Headers is a minor bottleneck in our infrastructure, I'll try to get to benchmarking this next week in our live systems. |
@avar 👍 |
I've done a pretty un-scientific benchmark with the simple code, and the performance increase was about 2%. Probably negligible, but it's not slower either. Might be more beneficial when there are more header variables and more operations to get the header value though. |
Just as an update I now have this running in prod on one of our roles, it doesn't do a lot of headers, and only sets a few so no idea how significant this'll be, but we do spend 3% of our time there in |
Do you see any improvements in terms of performance? I'm happy to pull this in as long as it doesn't degrade the perf, though. as far as I can see the "Fast" bit is the header rearrangement, and accessing the header doesn't make a big difference. |
It is faster, but I'd revert this for now due to incompatibilities. I've been running this on 2x boxes, one with the old code and one without, both are using statprofiler to get statistical sampling of performance time. The total time spent in HTTP::Headers is 3.26% for my app, v.s. 1.94% for ::Fast, so a clear benefit. However if you clone https://github.com/libwww-perl/http-message.git and search/replace HTTP::Headers->new with HTTP::Headers::Fast->new in t/headers.t you get quite a few failures. Including scary stuff like this (there are more failures than the ones I'm quoting here):
Failing with:
And:
I've filed tokuhirom/HTTP-Headers-Fast#3 against |
Thanks. I reverted it. |
As commented on tokuhirom/HTTP-Headers-Fast#3 these test failures are either minor illegality check, newly introduced method that's not available on CPAN yet, and a false failure because of subtle package variable change. So I think this is already safe, and these are not bugs in HTTP::Headers::Fast at this point. Re-merged with a cherry-pick on 9023699 |
Yeah, makes sense, \o/. |
Can someone profile/benchmark these?
cc @tokuhirom @kazeburo @avar