mirror of
https://github.com/home-assistant/core.git
synced 2025-08-02 20:25:07 +02:00
Small speed up to setting up integrations and config entries (#117278)
* Small speed up to setting up integration and config entries When profiling tests, I noticed many calls to get_running_loop. In the places where we are already in a coro, pass the existing loop so it does not have to be looked up. I did not do this for places were we are not in a coro since there is risk that an integration could be doing a non-thread-safe call and its better that the code raises when trying to fetch the running loop vs the performance improvement for these cases. * fix merge * missed some
This commit is contained in:
@@ -427,7 +427,11 @@ async def async_from_config_dict(
|
||||
if not all(
|
||||
await asyncio.gather(
|
||||
*(
|
||||
create_eager_task(async_setup_component(hass, domain, config))
|
||||
create_eager_task(
|
||||
async_setup_component(hass, domain, config),
|
||||
name=f"bootstrap setup {domain}",
|
||||
loop=hass.loop,
|
||||
)
|
||||
for domain in CORE_INTEGRATIONS
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user