-
-
Notifications
You must be signed in to change notification settings - Fork 1
Performance: DefaultSummaryMetadataFactory->getSummaryClasses result should be cached #650
Description
After deploying my project with the newly installed analytics-bundle to the server I experienced a severe performance degradation. Instead of loading my pages in < 1 sec they now required 3-10 seconds. Those pages don't even call the Analytics services.
Locally I didn't have this problem. I assume it's related to those two things that are configured in my server environment:
- Depoyments are done with deployer.org, so the Webserver root is based on a symlink to the release directory (
/var/www/vhosts/example.com/stage.example.com/vhost/currentsymlinks to/var/www/vhosts/example.com/stage.example.com/vhost/releases/XXX) - I have open_basedir defined, so the realpath_cache is disabled
After investigation I could pinpoint the bottleneck at DefaultSummaryMetadataFactory->getSummaryClasses which is called from SummaryEntityListener->postLoad many times. This is on a page that's not even using Analytics, it's all calls triggered by the postLoad:
I can also provide the interactive SVG file if you want. It just contains some implementation details I don't want to share publicly, so we would need a private channel, e.g. email.
I could fix it by locally caching the $classes array as a class property of DefaultSummaryMetadataFactory and will provide a PR.
