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

Optimize sensor list performance #4853

Merged
merged 1 commit into from
Nov 30, 2024

Conversation

jpelgrom
Copy link
Member

Summary

  • Prevent the list being filtered again every time something in the database is changed but the values don't change
  • Perform filtering of the sensors list on the IO thread instead of the main thread

Fixes #4808. A trace showed me a lot of time spent on filtering the list which shouldn't happen when toggling the sensor setting:

Trace showing a very wide block for filterSensorsList

Screenshots

n/a but it is noticeable when using the list

Link to pull request in Documentation repository

n/a

Any other notes

 - Prevent the list being filtered again every time something in the database is changed but the values don't change
 - Perform filtering of the sensors list on the IO thread instead of the main thread
@dshokouhi dshokouhi merged commit e7d5e4d into home-assistant:master Nov 30, 2024
4 checks passed
@jpelgrom jpelgrom deleted the optimize-sensors-list branch November 30, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sensor setting toggles are laggy (when using filtered sensor list)
2 participants