fix: benchmarks measured 307 redirects instead of the endpoints - #16
Merged
KissPeter merged 1 commit intoSep 24, 2026
Merged
Conversation
Owner
|
Thanks @Vladgasik, let me check it |
KissPeter
enabled auto-merge
September 23, 2026 20:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Situation
The repository publishes throughput comparisons between FastAPI configurations,
measured with
abagainst containers indocker-compose.yml. The endpointsunder test are declared with a trailing slash (
/sync/big_json_response/,/async/items/)Complication
33 of those measurement configurations request the endpoints without the
trailing slash. FastAPI's default
redirect_slashes=Trueanswers 307 withempty body and
abdoesn't follow redirects. So those runs timed the emissionof a redirect, not the endpoint.
Resolution
Merge this branch (no new dependencies)
Evidence
The mismatch
Against the unmodified
combocontainers:What each URL measures
Harness parameters (
ab -c 100 -n 500), driven from a container inside thecompose network, warm-up plus 3 runs averaged:
combo_worst_sync_json/async/big_json_responsecombo_worst_sync_json/async/big_json_response/combo_best_async_orjson/async/big_json_responsecombo_best_async_orjson/async/big_json_response/The published 3433 RPS on a 1 MB payload would require ~3.4 GB/s of serialisation
and transfer inside a 2-CPU container.
The guard
test_pool_exhaustion,test_robustnessandtest_concurrencydrive the appthrough
httpxrather thanTestContainer, so the assertion does not affect them.The
middlewares,json_classes,sync_asyncandserver_runnerstests alreadyused correct URLs and are unchanged by this PR.
Deliberately out of scope
The measurement tables in
index.md,nginx_port_socket.md,workers_and_threads.mdandkeepalive.mdcame from the broken configurationsand need a fresh CI run on your hardware; numbers from a different machine would
not be comparable, so they are left untouched.
Expect a longer suite: the big-JSON tests previously ran at redirect speed
(~4500 RPS) and now run at endpoint speed (tens of RPS).