Looking at performance data for load.php requests, I notice that we spend quite a lot of time in SitesModuleWorker::getSitesHash(). So I would like to know what that method does.
I grep for it, and find that it calls SitesModuleWorker::getSites(). SitesModuleWorker::getSites(), in turn, calls SiteStore::getSites().
But SiteStore is an interface, and I don't know which concrete implementation SitesModuleWorker is using, because the implementation is specified via a parameter to SitesModuleWorker::__construct(). So I need to look and see where SitesModuleWorker is instantiated.
That takes me to lib/includes/modules/SitesModule.php:29, where I see that it is SiteSQLStore::newInstance(). OK.
But where is SiteSQLStore? Oh, I see that it's in Core. OK, let's pull it up and see what its SiteSQLStore::getSites() method does.