From 43fb68ed79bfa0e87600f5203f523b58a0e678cb Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 14 Jan 2023 02:25:03 -1000 Subject: [PATCH] Avoid linear searches for excluded events (#85851) If the there are a lot of excluded events for the recorder, it can have a performance impact as the list has to be searched every time an event fires in HA --- homeassistant/components/recorder/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/recorder/core.py b/homeassistant/components/recorder/core.py index 4cc82ec6ebb..20a98af4b2f 100644 --- a/homeassistant/components/recorder/core.py +++ b/homeassistant/components/recorder/core.py @@ -186,7 +186,7 @@ class Recorder(threading.Thread): self.run_history = RunHistory() self.entity_filter = entity_filter - self.exclude_t = exclude_t + self.exclude_t = set(exclude_t) self.schema_version = 0 self._commits_without_expire = 0