GithubHelp home page GithubHelp logo

Comments (5)

1st1 avatar 1st1 commented on May 19, 2024

What would be the best practice approach to doing this? Combine with tornado or any other async libary?

uvloop only works with asyncio. It cannot work with Tornado, gevent, curio, or any other async Python library other than asyncio.

Leverage other smaller libraries to handle things like user authentication and http parsing. Or does uvloop just need these features introduced directly into it to maintain the performance it currently has?

asyncio is an async library that implements many low-level and high-level abstractions. It has Protocols and Transports, helpers to create network servers and clients, etc. I highly recommend you to glance over the documentation.

asyncio is built around the event loop. That's the thing that runs asyncio. uvloop is an implementation of a fast event loop for asyncio.

Now, asyncio, by itself, doesn't provide any high-level tools for you to write applications. For instance, it lacks an HTTP protocol implementation, etc. You need other libraries built for asyncio to do that for you. For HTTP, right now, there is aiohttp. There are many other libraries for working with databases, using AMQP brokers, etc.

The performance on it is very impressive, however, it's so low level, taking this into a production application would be quite a challenge.

Once you have an asyncio application, speeding it up with uvloop is very easy -- just install the uvloop policy (see the README file).

from uvloop.

digitaldavenyc avatar digitaldavenyc commented on May 19, 2024

I highly recommend you to glance over the documentation.

Do you mean I should review uvloop's documention or asyncio's?

You need other libraries built for asyncio to do that for you. For HTTP, right now, there is aiohttp.

In your blog post you mentioned that the performance in aiohttp was pretty bad with uvloop due to aiohttp's HTTP parser. Wouldn't httptools be the prefered library for handing HTTP requests in order to maintain the performance measured in the benchmarks?

from uvloop.

1st1 avatar 1st1 commented on May 19, 2024

Do you mean I should review uvloop's documention or asyncio's?

asyncio documentation to get a better idea of what it's capable of.

In your blog post you mentioned that the performance in aiohttp was pretty bad with uvloop due to aiohttp's HTTP parser. Wouldn't httptools be the prefered library for handing HTTP requests?

Right. The httptools package at this moment doesn't provide an implementation of HTTP, it only has a high-performance parser. So right now, aiohttp is the only option, but I hope its newly discovered performance issues will be fixed soon (by incorporating httptools or somehow else).

from uvloop.

digitaldavenyc avatar digitaldavenyc commented on May 19, 2024

There was already an issue open over at aiohttp for swapping out the http parser for httptools. If the performance issues could be solved in the near future both libraries could be thrown into the spotlight. Being able to stay on the same performance level with Go is huge. Thank you so much for contributing this library to the community!

from uvloop.

1st1 avatar 1st1 commented on May 19, 2024

Thanks!
Closing this issue.

from uvloop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.