Closed adriangb closed 2 years ago
Merging #32 (378df0f) into main (7985030) will decrease coverage by
0.49%
. The diff coverage is73.21%
.
@@ Coverage Diff @@
## main #32 +/- ##
==========================================
- Coverage 98.11% 97.62% -0.50%
==========================================
Files 172 172
Lines 5412 5473 +61
Branches 624 639 +15
==========================================
+ Hits 5310 5343 +33
- Misses 56 78 +22
- Partials 46 52 +6
Impacted Files | Coverage Δ | |
---|---|---|
xpresso/routing/router.py | 66.12% <63.79%> (-33.88%) |
:arrow_down: |
xpresso/applications.py | 90.24% <80.43%> (-5.30%) |
:arrow_down: |
xpresso/_utils/routing.py | 96.66% <100.00%> (+0.11%) |
:arrow_up: |
xpresso/exception_handlers.py | 100.00% <100.00%> (ø) |
|
xpresso/responses.py | 100.00% <100.00%> (ø) |
This change:
Mount
,Host
, etc.App
since there can only ever be 1 lifespan and there can only be 1App
.As part of this,
App
no longer inherits fromStarlette
andRouter
no longer inherits from its counterpart in Starlette. This both simplifies things and complicates them a bit, but it does give us the opportunity to do a bit of cleanup and performance optimization (slots, removing lifespan wrappers and making routing sans-io)There are obviously cons to this though. I might let this stew a bit and see.
Here are the benchmark numbers using the benchmarks in
/benchmark
:So it looks like this is a pretty solid +10% performance boost for simple scenarios