User tests: Successful: Unsuccessful:
getAssociations() is called several times in the life of a Joomla! process.
This PR optimize it by locally caching the result
Even better: apply this together with #7136. If OK, you can give "@test OK" to both PRs
Well, TBH, it is just a matter of few ms gained, nothing to write home about, but anyway...
Few ms here few ms there we end up with a great CMS
... thinking about if we should/can move/add something like that at the DB driver level, taking into account the queries hash... Poor men's Memcached...
Labels |
Added:
?
|
Labels |
Added:
?
|
Category | ⇒ | Multilanguage |
Status | New | ⇒ | Pending |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-06-07 23:50:34 |
Closed_By | ⇒ | smz |
This PR is a HUGE mistake! getAssociations() can be (and is) called with different primary keys, so we cannot just cache it like I did.
What a shame!
OK, after all it can be done: as @wilsonge correctly suggests, there are good odds that this is called only with the ID of the current page.
So it may be worth to create a $cache array in which to store results for every $pk with which this is called and most of the times it will be an array of just one element...
Reopening and correcting.
Status | Closed | ⇒ | New |
Closed_Date | 2015-06-07 23:50:34 | ⇒ | |
Closed_By | smz | ⇒ |
Please specify in PR title and test instructions that this only concerns getAssociations() for menu items.
Title |
|
Title |
|
@infograf768 done!
Status | New | ⇒ | Pending |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-07-13 08:09:15 |
Closed_By | ⇒ | smz |
Please test this together with #7136