Conversation
| self._upgraded = True | ||
|
|
||
| encoding = None | ||
| enc = headers.get(hdrs.CONTENT_ENCODING) |
There was a problem hiding this comment.
Is there any need to have two variables to reference on content encoding?
| return HttpVersion10 | ||
| elif parser.http_minor == 1: | ||
| return HttpVersion11 | ||
|
|
There was a problem hiding this comment.
Should we crash if version will be something weird?
| messages = self._messages | ||
| self._messages = [] | ||
| else: | ||
| messages = () |
There was a problem hiding this comment.
self._messages are list, but here messages becomes a tuple.
There was a problem hiding this comment.
i do not want to convert messages into tuple. doesnt really matter
| size_t max_field_size=8190): | ||
| self._init(cparser.HTTP_REQUEST, protocol, loop, | ||
| max_line_size, max_headers, max_field_size) | ||
| #self._proto_on_url = getattr(protocol, 'on_url', None) |
There was a problem hiding this comment.
i've not decided on url, http-parser provides url parsing, should give some more performance, but it requires yarl integration
| const char *at, size_t length) except -1: | ||
| cdef HttpParser pyparser = <HttpParser>parser.data | ||
| try: | ||
| #pyparser.url = _parse_url(at[:length], length) |
| cdef int cb_on_chunk_complete(cparser.http_parser* parser) except -1: | ||
| cdef HttpParser pyparser = <HttpParser>parser.data | ||
| try: | ||
| pass |
| cdef class URL: | ||
| cdef readonly str schema | ||
| cdef readonly str host | ||
| cdef readonly object port |
There was a problem hiding this comment.
i have no idea :)
url handling needs some more work
| loop=self._loop)) | ||
| return | ||
| except Exception as exc: | ||
| print('exc') |
|
|
||
| # feed payload | ||
| else: | ||
| if data: |
|
|
||
|
|
||
| @pytest.mark.xfail | ||
| # @pytest.mark.xfail |
There was a problem hiding this comment.
May be remove all these # pytest.mark.xfail?
There was a problem hiding this comment.
i do not understand those tests, i need andrew help
Codecov Report
@@ Coverage Diff @@
## master #1626 +/- ##
=========================================
Coverage ? 94.61%
=========================================
Files ? 31
Lines ? 7395
Branches ? 1281
=========================================
Hits ? 6997
Misses ? 264
Partials ? 134
Continue to review full report at Codecov.
|
|
added http-parser's url parsing functionality. on my mac i get ~14.3k rps, ~7k was on 1.3 |
|
1.2 is slightly faster than 1.3, ~7.3k rps |
|
with all latest changes i could get ~16.2rps interestingly, |
|
cool, i didn't know about |
|
@samuelcolvin added |
|
great! |
| by setup_test_loop. | ||
|
|
||
| """ | ||
| if fast is None: |
There was a problem hiding this comment.
I think this should be
fast |= TESTS_FASTthat way if you're testing with pytest and have AIOHTTP_TESTS_FAST=True but don't supply the --fast argument you get fast tests.
With current setup AIOHTTP_TESTS_FAST has no effect with pytest.
There was a problem hiding this comment.
I think AIOHTTP_TESTS_FAST is not needed
|
i modified gunicorn worker to disable access log if access log is not configured on my mac i got ~60k rps t_srv.py: async def intro(request):
resp = Response(status=200)
return resp
def init():
app = Application()
app.router.add_get('/', intro)
return app
app = init()gunicorn command: and wrk command: |
ba056e3 to
ea68872
Compare
1f2d965 to
a92549e
Compare
|
merged to master @kxepal if you want to modify cython code, just modify on master |
added c-based http parser, cython code is based on https://github.com/MagicStack/httptools
it gives ~15-25% increase