Avoid loading goals data multiple times for goal metrics by sgiehl · Pull Request #19838 · matomo-org/matomo · GitHub
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

Avoid loading goals data multiple times for goal metrics #19838

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Oct 10, 2022

Description:

Currently when a report showing goal specific metrics is loaded, each metric will trigger a request to Goals.getGoals to fetch the goals details in order to find the name.
This might depending on the number of goals decrease the performance. On a goals overview page, with six configured goals, the API method is currently called 54 times.
With this PR the API is only called once per requested report. So the number of calls is lowered to only 2!

Review

@sgiehl sgiehl added c: Performance For when we could improve the performance / speed of Matomo. Needs Review PRs that need a code review labels Oct 10, 2022
@sgiehl sgiehl added this to the 4.12.1 milestone Oct 10, 2022
Copy link
Contributor

@bx80 bx80 left a comment

Choose a reason for hiding this comment

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

Nice optimisation! 🙂

@bx80 bx80 merged commit 6435cdc into 4.x-dev Oct 17, 2022
@bx80 bx80 deleted the goalsimprovement branch October 17, 2022 21:02
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants