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

Improve performance by caching all translations in a flat array #6060

Closed
tsteur opened this issue Aug 25, 2014 · 0 comments
Closed

Improve performance by caching all translations in a flat array #6060

tsteur opened this issue Aug 25, 2014 · 0 comments
Assignees
Labels
c: Performance For when we could improve the performance / speed of Matomo. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Aug 25, 2014

In #5863 we do already cache plugin translations. Thinking a bit further we could do this for core translations as well. This alone wouldn't bring a huge performance improvement since we would save more or less only the json_decode. But we could save plugin and core translations in a flat array as it was originally:

$translations = array('Actions_Key' => '', ...);

https://github.com/piwik/piwik/blob/master/core/Translate.php#L172
https://github.com/piwik/piwik/blob/master/core/Piwik.php#L829

Those methods are often called > 1000 times in each page request. It would still bring only 10-40 ms which does not seem a lot but if you think about that the median API response time of some "competitors" is less than 10ms in total it is a lot.

@tsteur tsteur added this to the Mid term milestone Aug 25, 2014
@mattab mattab added the c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. label Sep 9, 2014
@mnapoli mnapoli modified the milestones: Piwik 2.11.0, Mid term Jan 9, 2015
@mnapoli mnapoli self-assigned this Jan 9, 2015
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. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Projects
None yet
Development

No branches or pull requests

3 participants