[BUGFIX] Speed up SiteConfiguration loading 78/61078/4
authorBenni Mack <benni@typo3.org>
Mon, 17 Jun 2019 19:39:18 +0000 (21:39 +0200)
committerBenni Mack <benni@typo3.org>
Wed, 19 Jun 2019 11:20:34 +0000 (13:20 +0200)
commitb5539e3dd5d9b786acc32078e41dba5abd0f4553
treea41cc2b3fd8c7d8a382ff12b68eb39e53cdf9b2e
parent4ec169f2cd663d28323be7a80068b5706512a80f
[BUGFIX] Speed up SiteConfiguration loading

Profiling shows that when linking to 100
pages, SiteFinder (which instantiates SiteConfiguration)
is instantiated 100 times. Although SiteFinder information
might change during one request, the SiteConfiguration
does not (except when updating the Configuration via API).

So, a first-level-cache can be used to avoid calls
to "cache_core" multiple times during one request,
and SiteConfiguration can become a Singleton instance.

Resolves: #88577
Releases: master, 9.5
Change-Id: I3d9167da9442d684d32a73d6cf2003c91bdf4d68
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61078
Tested-by: Benjamin Franzke <bfr@qbus.de>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Benjamin Franzke <bfr@qbus.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Classes/Form/FormDataProvider/SiteDatabaseEditRow.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/SiteDatabaseEditRowTest.php
typo3/sysext/core/Classes/Configuration/SiteConfiguration.php
typo3/sysext/core/Classes/Site/SiteFinder.php