New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve http handler performance #93324
Conversation
- Predetermine how to run the handler instead of every time - Make hass a closure variable to avoid the lookup each time - Offload the bytes/text conversions to aiohttp since it already handles it
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @Tho85, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
DescriptionXmlView(config).register(hass, app, app.router) | ||
HueUsernameView().register(hass, app, app.router) | ||
HueConfigView(config).register(hass, app, app.router) | ||
HueUnauthorizedUser().register(hass, app, app.router) | ||
HueAllLightsStateView(config).register(hass, app, app.router) | ||
HueOneLightStateView(config).register(hass, app, app.router) | ||
HueOneLightChangeView(config).register(hass, app, app.router) | ||
HueAllGroupsStateView(config).register(hass, app, app.router) | ||
HueGroupView(config).register(hass, app, app.router) | ||
HueFullStateView(config).register(hass, app, app.router) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all legacy. This really should be move to a library.
thanks |
Proposed change
asyncio.iscoroutinefunction
every time) -- This is effectively the same thing we do inHassJob
to eliminate this call every time since it does an expensive inspect under the hood.Almost every request has to go through here, which means almost any improvement here will speed up every request.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: