Improve performance by caching all translations in a flat array #6060
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
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: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.
The text was updated successfully, but these errors were encountered: