Skip to content

Skip header validation for data parsed off the wire #33

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

Merged
merged 1 commit into from
Mar 20, 2018

Conversation

njsmith
Copy link
Member

@njsmith njsmith commented Feb 28, 2017

The parser already validates, so there's no need to do it twice, and
it's a bit expensive.

On my laptop, on the benchmark in bench/, I get:
CPython 3.5: ~4386 req/sec -> ~5141 req/sec = 17% speedup
PyPy 5.6.0: ~19311 req/sec -> ~21106 req/sec = 9% speedup

@codecov
Copy link

codecov bot commented Feb 28, 2017

Codecov Report

Merging #33 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master    #33   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          21     21           
  Lines         904    908    +4     
  Branches      173    175    +2     
=====================================
+ Hits          904    908    +4
Impacted Files Coverage Δ
h11/_readers.py 100% <100%> (ø) ⬆️
h11/_headers.py 100% <100%> (ø) ⬆️
h11/_events.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a894b10...022dd88. Read the comment docs.

The parser already validates, so there's no need to do it twice, and
it's a bit expensive.

On my laptop, on the benchmark in bench/, I get:
  CPython 3.5: ~4386 req/sec -> ~5141 req/sec = 17% speedup
  PyPy 5.6.0: ~19311 req/sec -> ~21106 req/sec = 9% speedup
Copy link

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm the speed improvements and the changes make sense to me. However, I'm not familiar with the h11 code base.

@njsmith njsmith merged commit e432853 into master Mar 20, 2018
@njsmith njsmith deleted the reduce-double-checking branch March 20, 2018 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants