gitmyhub

japronto

C ★ 8.5k updated 2y ago

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

A Python web framework built for maximum speed using a C-based HTTP server core, capable of handling over a million requests per second, aimed at experienced developers, not recommended for production use.

CPythonuvlooppicohttpparsersetup: hardcomplexity 4/5

Japronto is a Python web framework focused on raw speed. It is designed to handle HTTP requests as fast as possible, and benchmarks shown in the README demonstrate it processing over a million requests per second on a standard cloud server. The name comes from Portuguese meaning "already done," which reflects its emphasis on quick responses.

Under the hood, Japronto is built differently from most Python web frameworks. The core server is written in C rather than Python, which lets it avoid a lot of the overhead that slows down typical Python HTTP handling. It uses two external components to achieve this: uvloop (a fast async event loop based on libuv) for handling input and output without blocking, and picohttpparser (a minimal C library) for parsing HTTP headers quickly. The result is a Python framework with performance closer to what you would expect from a compiled language.

Writing a web application with Japronto looks similar to other Python frameworks. You define functions that handle specific URL routes, and the framework calls them when a matching request comes in. It supports both regular synchronous functions and asynchronous ones for tasks that involve waiting, such as database queries. It also supports HTTP pipelining, where multiple requests can be sent on a single connection before waiting for responses.

The project README is direct about its limitations: it is an early-stage tool aimed at experienced developers who are comfortable working at a low level and understand some C. It is not recommended for production use and is not suited for beginners. Active development has paused, though the project accepts contributions. It is released under the MIT license.

Where it fits