adriangb / xpresso

A composable Python ASGI web framework
https://xpresso-api.dev/
MIT License
178 stars 4 forks source link

perf: skip dependency injection if there are no dependencies #14

Closed adriangb closed 2 years ago

adriangb commented 2 years ago

This is a small optimization but it can help with things like a /healthcheck endpoint. We'd just need to add a special case in Operator.solve to do self._app = _SimpleOperationApp or something like that.

The alternative is to just tell users to use Stalette routes for this use case, but then they won't get documented in OpenAPI.

adriangb commented 2 years ago

Not worth it, di is a lot faster now