Avatar for the sparckles user
sparckles
Robyn
BlogDocsChangelog

Performance History

Latest Results

[pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.14.13 → v0.15.12](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.13...v0.15.12)
pre-commit-ci-update-config
20 hours ago
Release 0.85.0
main
2 days ago
Release 0.84.0
main
2 days ago
perf: skip Python Response wrapping for bare dict/list/str/bytes returns (#1384) * perf: skip Python Response wrapping for bare dict/list/str/bytes returns Handlers that return a dict/list/str/bytes no longer allocate a Python-side `Response(...)` or fresh `Headers({...})` per request. The router now lets those values flow through to the Rust executor, which: - downcasts `#[pyclass] Response` directly (0 getattr calls) when the user did return one, - serializes bare dicts/lists via a cached `orjson.dumps`, - wraps bare str/bytes with prebuilt content-type headers, - falls back to the existing `FromPyObject<Response>` chain for subclasses. Also skips the per-request `contextvars.Context()` allocation when no middleware is registered — the #1380 cross-phase context is only needed when `before_request`/`after_request` hooks can mutate `ContextVar`s. Local micro-benchmark on `/json` (workers=1, processes=1, single-threaded urllib client): 4013 rps -> 5728 rps (+43%). All 339 integration tests and 23 unit tests pass (6 pre-existing `test_openapi_schema.py` failures unrelated to this change). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * review: address CodeRabbit feedback - cargo fmt: wrap the `get_description_from_pyobject` call that rustfmt flagged on the PyResponse fast path. - `downcast_exact::<PyResponse>()` so user Response subclasses with overridden properties fall through to the getattr slow path, preserving their custom read semantics. - `downcast` (not `downcast_exact`) for PyDict/PyList/PyString/PyBytes so primitive subclasses match the Python router's `isinstance(...)` gate instead of falling through to the FromPyObject chain (which would fail with TypeError). - Revert the conditional per-request `contextvars.Context()`: with it skipped, sync handlers calling `ContextVar.set(...)` would leak values into the next request on the same worker thread, weakening the #1380 isolation guarantee. The J1-J4 fast paths alone still deliver the win (~+43% locally on /json with workers=1, processes=1). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
main
5 days ago

Latest Branches

CodSpeed Performance Gauge
0%
[pre-commit.ci] pre-commit autoupdate#1383
20 hours ago
cded7cd
pre-commit-ci-update-config
CodSpeed Performance Gauge
0%
perf: skip Python Response wrapping for bare dict/list/str/bytes returns#1384
6 days ago
f94f975
perf/json-fast-path
CodSpeed Performance Gauge
0%
9 days ago
ab4bb07
fix/openapi-schema-generation-v2
© 2026 CodSpeed Technology
Home Terms Privacy Docs