uvloop VS sanic

Compare uvloop vs sanic and see what are their differences.

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
uvloop sanic
14 16
9,994 17,729
1.4% 0.5%
5.5 8.5
about 1 month ago 15 days ago
Cython Python
Apache License 2.0 MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

uvloop

Posts with mentions or reviews of uvloop. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-06.
  • APIs in Go with Huma 2.0
    6 projects | dev.to | 6 Dec 2023
    I wound up on a different team with pre-existing Python code so temporarily shelved my use of Go for a bit, and we used Sanic (an async Python framework built on top of the excellent uvloop & libuv that also powers Node.js) to build some APIs for live channel management & operations. We hand-wrote our OpenAPI and used it to generate documentation and a CLI, which was an improvement over what was there (or not) before. Other teams used the OpenAPI document to generate SDKs to interact with our service.
  • Python Is Easy. Go Is Simple. Simple = Easy
    5 projects | news.ycombinator.com | 27 Nov 2023
  • will requests-html library work as selenium
    5 projects | /r/Python | 13 Feb 2023
    If you're looking for maximum requests per second you can change the asyncio event loop with one like UVLoop.
  • Benchmark asyncio vs gevent vs native epoll
    1 project | dev.to | 13 Dec 2022
    An optional package uvloop can also be install if working on Linux:
  • A Look on Python Web Performance at the end of 2022
    10 projects | dev.to | 14 Nov 2022
    The source code from the project resides in the github, with more than 8.6k stars and 596 forks is a very popular github, but no new releases are made since 2018, looks pure much not maintained anymore, no PR's are accepted no Issues are closed, still without windows or macOS Silicon, or PyPy3 support. Japronto it self uses uvloop with more than 9k stars and 521 forks and different from japronto is seems to be well maintained.
  • Modern Python Performance Considerations
    8 projects | news.ycombinator.com | 5 May 2022
    If you are building server-side applications using Python 3 and async API and if you didn't use https://github.com/MagicStack/uvloop, you are missing out on performance big time.

    Also, if you happen to build microservices, don't forget to try PyPy, that's another easy performance booster (if it's compatible to your app).

  • So it begins.
    1 project | /r/ProgrammerHumor | 1 May 2022
    Not that bad actually, with a different event loop implementation (such as https://github.com/MagicStack/uvloop). Not sure how well it will perform in a browser though
  • SearX On Windows: A Short(ish) Tech Journey
    3 projects | /r/u_SyntaxAerror | 17 Apr 2022
    And so I did some searching, and found that SearX isn't officially supported on Windows. Not to be deterred, I did another quick search and found that with pip and/or docker, you should be able to install SearX straightforwardly on Windows. After trying this for a bit, I realized that uvloop, a (questionably optional dependency of SearX) is not supported on Windows. I tried a couple things to get it to work, but they didn't end up working for me either through user error, ignorance, or plain old not working.
  • EdgeDB 1.0
    16 projects | news.ycombinator.com | 10 Feb 2022
    they also wrote uvloop [0] which is fantastic and advances the cutting edge of what can be done with modern asyncio-based Python. I saw a ~3x improvement in the throughput of a microservice I wrote when I first tried it out years ago. currently at $dayjob we just use it by default in every Python service, whether or not we expect that service to be performance-critical.

    0: https://github.com/MagicStack/uvloop

  • How does asynchronous code work in programming languages?
    2 projects | /r/ProgrammingLanguages | 10 Jan 2022
    If you manage to grok how uvloop works as well as Python's default asyncio loop scheduler, you'll understand this style. It is not by itself a parallelism enabler, but network I/O the coroutines triggered would run in parallel nevertheless, though CPU bound computations would not by default.

sanic

Posts with mentions or reviews of sanic. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-12-08.
  • Sanic Framework – Build fast. Run fast. Accelerate your web app development
    1 project | news.ycombinator.com | 22 Jun 2023
  • Concert - My submission for MongoDB Hackathon on DEV
    4 projects | dev.to | 8 Dec 2022
    My app fits into multiple categories 1) Since you can search for stages with Atlas Search 2) The entire app is real-time 3) The backend was built with Python and Sanic ASGI framework.
  • A Look on Python Web Performance at the end of 2022
    10 projects | dev.to | 14 Nov 2022
    Sanic is very very popular with 16.6k stars, 1.5k forks, opencollective sponsors and a very active github. Falcon is more popular than japronto with 8.9k stars, 898 forks, opencollective sponsors and a very active github too. Despite Japronto been keeped as first place by TechEmPower, Falcon is a way better solution in general with performance similar to fastify an very fast node.js framework that hits 575k requests per second in this benchmark.
  • Ask HN: Programming Without a Build System?
    15 projects | news.ycombinator.com | 12 Nov 2022
    > trying to build a lifeboat for Twitter, Python works, but then modules require builds that break.

    > Alternatively, any good resources for the above?

    There are many, _unbelievably many_ writeups and tools for Python building and packaging. Some of them are really neat! But paralysis of choice is real. So is the reality that many of the new/fully integrated/cutting edge tools, however superior they may be, just won't get long term support to catch on and stay relevant.

    When getting started with Python, I very personally like to choose from a few simple options (others are likely to pipe up with their own, and that's great; mine aren't The One Right Way, just some fairly cold/mainstream takes).

    1. First pick what stack you'll be using to develop and test software. In Python this is sadly often going to be different from the stack you'll use to deploy/run it in production, but here we are. There are two sub-choices to be made here:

    1.a. How will you be running the _python interpreter_ in dev/test? "I just want to use the Python that came with my laptop" is fine to a point, but breaks down a lot sooner than folks expect (again, the reasons for this are variously reasonable and stupid, but here we are). Personally, I like pyenv (https://github.com/pyenv/pyenv) here. It's a simple tool that builds interpreters on your system and provides shell aliases to adjust pathing so they can optionally be used. At the opposite extreme from pyenv, some folks choose Python-in-Docker here (pros: reproducible, makes deployment environments very consistent with dev; cons: IDE/quick build-and-run automations get tricker). There are some other tools that wrap/automate the same stuff that pyenv does.

    1.b. How will you be isolating your project's dependencies? "I want to install dependencies globally" breaks down (or worse, breaks your laptop!) pretty quickly, yes it's a bummer. There are three options here: if you really eschew automations/wrappers/thick tools in general, you can do this yourself (i.e. via "pip install --local", optionally in a dedicated development workstation user account); you can use venv (https://docs.python.org/3/library/venv.html stdlib version of virtualenv, yes the names suck and confusing, here we are etc. etc.), which is widely standardized upon and manually use "pip install" while inside your virtualenv, and you can optionally integrate your virtualenv with pyenv so "inside your virtualenv" is easy to achieve via pyenv-virtualenv (https://github.com/pyenv/pyenv-virtualenv); or you can say "hell with this, I want maximum convenience via a wrapper that manages my whole project" and use Poetry (https://python-poetry.org/). There's no right point on that spectrum, it's up to you to decide where you fall on the "I want an integrated experience and to start prototyping quickly" versus "I want to reduce customizations/wrappers/tooling layers" spectrum.

    2. Then, pick how you'll be developing said software: what frameworks or tools you'll be using. A Twitter lifeboat sounds like a webapp, so you'll likely want a web framework. Python has a spectrum of those of varying "thickness"/batteries-included-ness. At the minimum of thickness are tools like Flask (https://flask.palletsprojects.com/en/2.2.x/) and Sanic (like Flask, but with a bias towards performance at the cost of using async and some newer Python programming techniques which tend, in Python, to be harder than the traditional Flask approach: https://sanic.dev). At the maximum of thickness are things like Django/Pyramid. With the minimally-thick frameworks you'll end up plugging together other libraries for things like e.g. database access or web content serving/templating, with the maximally-thick approach that is included but opinionated. Same as before: no right answers, but be clear on the axis (or axes) along with you're choosing.

    3. Choose how you'll be deploying/running the software, maybe after prototyping for awhile. This isn't "lock yourself into a cloud provider/hosting platform", but rather a choice about what tools you use with the hosting environment. Docker is pretty uncontentious here, if you want a generic way to run your Python app on many environments. So is "configure Linux instances to run equivalent Python/package versions to your dev/test environment". If you choose the latter, be aware that (and this is very important/often not discussed) many tools that the Python community suggests for local development or testing are very unsuitable for managing production environments (e.g. a tool based around shell state mutation is going to be extremely inconvenient to productionize).

    Yeah, that's a lot of choices, but in general there are some pretty obvious/uncontentious paths there. Pyenv-for-interpreters/Poetry-for-packaging-and-project-management/Flask-for-web-serving/Docker-for-production is not going to surprise anyone or break any assumptions. Docker/raw-venv/Django is going to be just as easy to Google your way through.

    Again, no one obvious right way (ha!) but plenty of valid options!

    Not sure if that's what you were after. If you want a "just show me how to get started"-type writeup rather than an overview on the choices involved, I'm sure folks here or some quick googling will turn up many!

  • An alternative to Elasticsearch that runs on a few MBs of RAM
    65 projects | news.ycombinator.com | 24 Oct 2022
  • sanic - an express.js-like web framework built in C
    2 projects | /r/opensource | 23 Oct 2022
    You might want to consider a different name though, as there's already a very popular python web framework called sanic: https://sanic.dev/
  • I've made a webapp to play Two Rooms and a Boom, and I'd love for you all to try it out!
    3 projects | /r/boardgames | 13 Oct 2022
    For those interested in the nitty-gritty of the application itself, the frontend is developed using vue.js with bulma.io css framework for styling. The backend is running on a laptop in my basement and is served by sanic.dev both for static content and api/websockets.
  • Top Python Coding Repos
    6 projects | dev.to | 5 Sep 2022
    requests - A simple, yet elegant, HTTP library. sanic - Next generation Python web server/framework | Build fast. Run fast. click - Python composable command line interface toolkit elasticsearch-dsl-py - High level Python client for Elasticsearch panel - A high-level app and dashboarding solution for Python internetarchive - A Python and Command-Line Interface to Archive.org coconut - Simple, elegant, Pythonic functional programming
  • Social media app made with FastAPI
    5 projects | /r/Python | 21 Jul 2022
    Personally I haven’t used it outside of trying a few very basic things. I’d recommend blacksheep if you want small, performant and low overhead, or sanic which, in my opinion, is the best choice if you do not need all the Django fluff.
  • Building a fullstack Bitcoin related webapp (hobby project), looking for a partner!
    2 projects | /r/Bitcoin | 9 Jun 2022
    check out https://sanic.dev or https://www.djangoproject.com for your backend

What are some alternatives?

When comparing uvloop and sanic you can also consider the following projects:

asyncio

fastapi - FastAPI framework, high performance, easy to learn, fast to code, ready for production

trio - Trio – a friendly Python library for async concurrency and I/O

Tornado - Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Twisted - Event-driven networking engine written in Python.

uvicorn-gunicorn-docker - Docker image with Uvicorn managed by Gunicorn for high-performance web applications in Python with performance auto-tuning.

uvicorn - An ASGI web server, for Python. 🦄

ipywidgets - Interactive Widgets for the Jupyter Notebook

asyncio - asyncio is a c++20 library to write concurrent code using the async/await syntax.

Svelte - Cybernetically enhanced web apps

pyzmq - PyZMQ: Python bindings for zeromq

justpy - An object oriented high-level Python Web Framework that requires no frontend programming