Over the last few weeks, I focused on removing overhead from the request hot path in Django Bolt. The results from v0.6.4 → v0.7.0 are honestly better than I expected. I remember when I put 60k RPS in GitHub README because that was the maximum I was able to get from this. Now the same endpoint under the same condition achieves 160k RPS.

github.com/dj-bolt/django-bolt

Here is how I did it.

⚡ Removed logging-related extra work from the Python hot path

Every request was paying a logging tax multiple time.time() calls, duration calculations, and formatting. I was surprised when I found out that for primitive requests, the logging is taking 28 % of the overhead. Flamegraphs saved the day here. No access logging is run in Rust. It still logs properly, it just does not do extra work not needed.

⚡ Zero-copy response bodies

Using PyBackedBytes allows response bodies to move between Python and Rust without extra memory copies. We get a reference to bytes inside the Python part, and actix can read the reference and send the data without copying the full response into Rust.

⚡ Trivially-async detection

Some async def views never actually await. These are now detected at registration time and dispatched synchronously using `core.send()`. So we don't have to use Tokio machinery for trivial async functions.

⚡ Lower allocation overhead

Optional hashmaps and static response metadata eliminate several small heap allocations per request. Before, we were allocating empty dicts instead of `None`, which is much faster.

⚡ Pre-compiled response handlers

Response serialization logic is compiled once during route registration instead of running isinstance chains on every request.

https://github.com/dj-bolt/django-bolt

GitHub - dj-bolt/django-bolt: Rust-powered API framework for Django achieving 60k+ RPS. Uses Actix Web for HTTP, PyO3 for Python bridging, msgspec for serialization. Decorator-based routing with built-in auth and middleware.

Rust-powered API framework for Django achieving 60k+ RPS. Uses Actix Web for HTTP, PyO3 for Python bridging, msgspec for serialization. Decorator-based routing with built-in auth and middleware. - ...

GitHub