Prototype
Quickset: Django read routes from recorded SQL
A Django API builds the same SQL again for every request. Quickset records that SQL once, checks that the response cannot change, and serves the route from the recording. On a 10-row route, one server process went from 2,915 requests a second to 14,713 in Python and 55,601 from a Rust executor.
- Role
- Design & development
- Timeline
- 2026 · prototype
- Built with
- Python, Django, Rust, PostgreSQL, Django-Bolt, PyO3, Tokio

- 19 times the requests per second
- The same bytes from every tier
- 279 tests on two framework versions
The same query, built again for every request
A read route in Django returns a QuerySet. For each request, Django builds it and compiles it to SQL again, and the text is almost always the same. In a loop on SQLite with no HTTP, a 10-row read took 200 microseconds through the ORM and 42 with the same SQL sent directly.
The usual answer is to rewrite the busy routes in a faster language, which leaves two code bases to keep correct. I set a harder brief: the route stays as it is written, and no request ever gets a different answer.
Record once, and refuse what cannot be proven
Quickset is an add-on for Django-Bolt, a framework that serves Django APIs from a Rust server. When the server starts, Quickset runs the route's function with sample values and records the SQL that Django writes. It parses no SQL. It compares what Django compiled across the runs, which shows where each parameter is bound and what is a constant.
A route is served from the recording only when every check passes. Otherwise it stays an ordinary route of the framework, and a command lists the reason.
- Three tiers: Django builds the query, the recorded query runs on a connection of Django, or it runs from Rust with no Python in the request
- One recorded statement for each range of values where Django writes different SQL, such as an integer too large for its column
- A check of the function's source: no clock, no state of the request, no custom manager, no branch
- PostgreSQL describes every statement before a route may run from Rust
Selected contributions
A Rust executor that answers as the framework does
The executor reads the request, runs the statement on its own connections and writes the JSON. It follows the framework's rules for reading a query string, the text of each error, and how a date, a time and a string are printed. Property tests compare its output with the Python encoder on generated values.
Parity as the main test
Every test route is declared three times, once for each tier, and each request goes to all three. The status, the content type and the body must be equal. About 150 fixed requests and seven property tests run against the released framework and against its development branch.
The framework's own fast path, reused
The framework's development branch can send a query from its event loop, so that no thread waits for the database. Quickset's Python tier sends its recorded statement the same way when a project turns that on. This tier keeps sign-in checks, logs and API documentation as they are.
Measured on one machine
With one server process, the 10-row route answered 2,915 requests a second on the framework alone. Quickset's Python tier answered 5,281, and 14,713 with event-loop reads on. The Rust tier answered 55,601. The server's processor time for one request fell from 391 microseconds to 68 in Python and 42 in Rust.
The charts above and the table below are drawn from the benchmark's own results file. Quickset is a working prototype with a test environment that runs in Docker. It is not published yet.
The measurement
Requests per second on three routes: 10 rows, 100 rows, and one row by its key. Under each figure: the processor time that the server used for one request. Measured 2026-12-02.
| Served by | 10 rows | 100 rows | 1 row |
|---|---|---|---|
| Django-Boltthe same route, as the framework serves it | 2,915391 µs | 1,913611 µs | 3,307349 µs |
| Django-Bolt, reads on its event loopa setting of its development branch | 4,209238 µs | 2,369423 µs | 5,564180 µs |
| Quickset, plan tierthe recorded SQL, on Django's connection | 5,281237 µs | 2,703465 µs | 6,072211 µs |
| Quickset, plan tier, on the event loopthe recorded SQL, with that setting | 14,71368 µs | 3,934254 µs | 23,68942 µs |
| Quickset, native tierthe recorded SQL, from Rust | 55,60142 µs | 23,816106 µs | 67,00434 µs |
One server process, PostgreSQL 17 in a second container, 64 connections, Docker on one Apple-silicon laptop, the median of five 8-second runs. Every variant returned the same bytes. The figures compare the variants on this machine. They are not a forecast for another one.
The speed was the easy part
Most of the work went into the cases where a faster answer would be a different answer: a filter on today's date, a tenant read from the request, an integer outside the range of its column. The executor is the smaller part of the code. The checks that decide when it may run are the product.
The measurement also changed the plan. On the event loop, the Python tier removes most of the work of a request, from 391 microseconds to 68 where Rust reaches 42, and it changes nothing else about a route. It became the tier to recommend, and Rust the option for the busiest public routes.

