I don’t believe computer performance is the problem. It’s in a docker container with the host having a CPU average of 15% (peak 40%) & ram to spare. Disk is local spinning rust.
Mine used to take so long it would time out, I moved to mariadb externally (still on the same Pi) and there is now between a 10-20 second delay before its shown.
I’m running venv and not a docker based one so from memory I just used apt to install mariadb, created a user for HA (mine is just ‘ha’), I believe I then created a database ‘homeassistant’ and gave ha full priviledges on it and then followed