Skip to content

Performance: DefaultSummaryMetadataFactory->getSummaryClasses result should be cached #650

@RafaelKr

Description

@RafaelKr

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/current symlinks 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:

Image

Zoomed in to the first stack:
Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions