uvloop blog and HTTP parser

450 views
Skip to first unread message

Samuel Colvin

unread,
May 5, 2016, 9:12:03 AM5/5/16
to aio-libs
I'm sure lots of people have seen:


on both the python-tulip group and hackernews.

It's very interesting and very positive about asyncio, however it does include:

the performance bottleneck in aiohttp turned out to be its HTTP parser, which is so slow, that it matters very little how fast the underlying I/O library is. 

They then go on to say they built a very simple web server httptools using the nodejs C http-parser.

Would there be any possibility of using the faster http parser in aiohttp?

Perhaps this would be best achieved by modifying aiohttp to allow substitutable http parsers then creating aiohttp-http-parser as a separate package? 

Сергей Тихонов

unread,
May 5, 2016, 9:50:36 AM5/5/16
to aio-libs
I've added httptools parser into test aiohttp app, just for fun. I haven't got any performance improvements, since httptools example replaces not only the parser itself, but also all other aiohttp components: url router, middleware support, even response generation.

Sergey Tikhonov.

четверг, 5 мая 2016 г., 16:12:03 UTC+3 пользователь Samuel Colvin написал:

Samuel Colvin

unread,
May 5, 2016, 9:59:29 AM5/5/16
to Сергей Тихонов, aio-libs
Great to see aiohttp http parsing is already composable.

Do you think there is a possibility of improving the performance of aiohttp to approach node or go as per the results in the blog below?

Perhaps the asyncio streams issue discussed on the python-tulip group accounts for some of the performance gap?

Samuel


--

Samuel Colvin
S...@muelColvin.com,
07801160713

--
You received this message because you are subscribed to a topic in the Google Groups "aio-libs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/aio-libs/XRqxf7zGNxQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to aio-libs+u...@googlegroups.com.
To post to this group, send email to aio-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aio-libs/54e0efed-bde4-4b6c-bff9-8973dc926c0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Сергей Тихонов

unread,
May 5, 2016, 11:53:15 AM5/5/16
to aio-libs, zim...@gmail.com, S...@muelcolvin.com
I think if you add routing, middleware and http-related RFCs handling to node server, you'll decrease nodejs performance to aiohttp level.
But if you don't need aiohttp server functionality - you can use vmbench as a starting point for a highly specialized single-purpose http server.

Sergey.

четверг, 5 мая 2016 г., 16:59:29 UTC+3 пользователь Samuel Colvin написал:
Reply all
Reply to author
Forward
0 new messages