Skip to content
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

Resolve and caches paths for CachingStaticResource in the executor #74474

Merged
merged 10 commits into from
Jul 6, 2022

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Jul 5, 2022

This is part of an optimization cycle to improve the responsiveness of the UI during first pickup and startup

Proposed change

Noticed in #74443 that we do I/O in the event loop

aiohttp does the stat in the executor so we likely should as well https://github.com/aio-libs/aiohttp/blob/6013bd4e17ae46e796e28c1380ff3bde2161008d/aiohttp/web_fileresponse.py#L143

Since this handler is specifically for static paths, we can also cache the result of the executor job.

Screen_Shot_2022-07-04_at_11_32_33_PM

Screen_Shot_2022-07-05_at_15_19_15

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (http) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@bdraco
Copy link
Member Author

bdraco commented Jul 5, 2022

I should move lru-dict into base requirements

@bdraco
Copy link
Member Author

bdraco commented Jul 6, 2022

Manual testing is good on this one, but I want to add some more coverage before merging

@bdraco bdraco marked this pull request as ready for review July 6, 2022 18:49
@bdraco bdraco requested a review from a team as a code owner July 6, 2022 18:49
@bdraco bdraco merged commit 332cf3c into home-assistant:dev Jul 6, 2022
@bdraco bdraco deleted the cached_static_io branch July 6, 2022 18:49
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants