Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache translated timezone name in enrichSite #18168

Merged
merged 3 commits into from Oct 18, 2021
Merged

Cache translated timezone name in enrichSite #18168

merged 3 commits into from Oct 18, 2021

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Oct 18, 2021

Description:

Noticed the getTimezoneName method can be very slow and CPU consuming. Especially new DateTimeZone($timezone); etc. Could technically cache the getTimezoneName method itself but figured it's a bit easier to only cache it for now in enrichSite as we then don't need to worry about cache key for different getTimezoneName parameters etc. The method isn't a concern when called from other places. Often most sites have the same timezone so this will be an improvement. On cloud we're calling getAllSites etc more often and we noticed it had a performance impact.

Review

@tsteur tsteur added the Needs Review PRs that need a code review label Oct 18, 2021
@tsteur tsteur added this to the 4.6.0 milestone Oct 18, 2021
@tsteur tsteur added c: Performance For when we could improve the performance / speed of Matomo. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Oct 18, 2021
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sgiehl sgiehl merged commit 9826875 into 4.x-dev Oct 18, 2021
@sgiehl sgiehl deleted the sitestest branch October 18, 2021 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants