fastapi
fastapi
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
⚡ Deduplicate get_flat_dependant calls in OpenAPI schema generation get_openapi_path called get_flat_dependant on the same route 3 times: once directly, once inside _get_openapi_operation_parameters, and once inside get_flat_params. All three computed the identical result. Hoist the computation before the method loop and pass the result to the internal consumers. This eliminates 2 redundant dependency-tree traversals per route during schema generation. Benchmark (10-200 routes, 3 deps each, Python 3.11): | Routes | Speed Δ | RAM Δ | |--------|---------|-------| | 10 | −11 % | ~0 % | | 50 | −6 % | 0 % | | 100 | −7 % | 0 % | | 200 | −10 % | 0 % |
sebastianbreguel:perf/dedup-flat-dependant-in-openapi
1 hour ago
⚡ Use set for security scope dedup and skip redundant jsonable_encoder Use a set instead of a list for scope deduplication in get_openapi_security_definitions, converting O(S²) membership checks to O(S). Output is sorted for deterministic schema generation. Guard jsonable_encoder with a dict membership check to skip redundant serialization when the same security scheme appears in multiple dependencies. Benchmark (50 scopes, 1-20 deps): Speed: 42.7 µs → 39.5 µs (−7%) RAM: 9.7 KB → 9.7 KB (0%)
sebastianbreguel:perf/security-scope-dedup-set
2 hours ago
🎨 Auto format
sebastianbreguel:perf/optimize-get-flat-dependant
2 hours ago
⚡ Optimize get_flat_dependant: set lookup + copy-on-write lists Use a set instead of a list for the visited tracker, converting the membership check from O(n) to O(1). DependencyCacheKey is a hashable tuple, so the swap is safe. Defer param list copies until a child actually has data to merge (copy-on-write). Nodes whose children carry no params skip all five list allocations entirely, which is the common case for paramless dependency functions. Skip the oauth_scopes property call and intermediate list concatenations when no scopes are present. Benchmarks (synthetic trees, min of 5×1000 runs, Python 3.11): | Scenario | Speed | RAM | |--------------|--------|--------| | Chain ×100 | −28 % | −12 % | | Wide 100×3 | −57 % | −29 % | | Diamond ×100 | −39 % | −31 % |
sebastianbreguel:perf/optimize-get-flat-dependant
2 hours ago
fix(sse): preserve empty data lines in SSE formatting
MatiasFormoso:fix-sse-empty-data-lines
4 hours ago
⚡️ Use `TypeAdapter.validate_json` instead of `json.loads`
dolfinus:feature/pydanticv2-validate-json-new
5 hours ago
Trigger CI
fix-typer-removed-isolated_filesystem
5 hours ago
⚡️ Use TypeAdapter.validate_json instead of json.loads
dolfinus:feature/pydanticv2-validate-json
5 hours ago
Latest Branches
CodSpeed Performance Gauge
0%
⚡ Deduplicate get_flat_dependant calls in OpenAPI schema generation
#15622
1 hour ago
2c58024
sebastianbreguel:perf/dedup-flat-dependant-in-openapi
CodSpeed Performance Gauge
0%
⚡ Use set for security scope dedup and skip redundant jsonable_encoder
#15621
2 hours ago
255b686
sebastianbreguel:perf/security-scope-dedup-set
CodSpeed Performance Gauge
0%
⚡ Optimize get_flat_dependant: set lookup + copy-on-write lists
#15620
2 hours ago
1e72c3e
sebastianbreguel:perf/optimize-get-flat-dependant
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs