Speed up reconnects by caching state serialize (#93050)

This commit is contained in:
J. Nick Koston
2023-05-16 02:33:12 -05:00
committed by GitHub
parent 9c039a17ea
commit 99265a983a
6 changed files with 152 additions and 53 deletions

View File

@ -9,7 +9,6 @@ from typing import Any, Final
import orjson
from homeassistant.core import Event, State
from homeassistant.util.file import write_utf8_file, write_utf8_file_atomic
from homeassistant.util.json import ( # pylint: disable=unused-import # noqa: F401
JSON_DECODE_EXCEPTIONS,
@ -189,6 +188,11 @@ def find_paths_unserializable_data(
This method is slow! Only use for error handling.
"""
from homeassistant.core import ( # pylint: disable=import-outside-toplevel
Event,
State,
)
to_process = deque([(bad_data, "$")])
invalid = {}