Improving performance: Override JTable::getFields()

Available Files

No files uploaded.

Related discussions

Sam Moffatt Discussion started by Sam Moffatt 10 years ago
One of the things I'm seeing with our JomSocial instance is that due to the use of JTable's, there are a large number of avoidable queries per page load to get the table columns. Out of 157 queries on my optimised version, 10 of them are "SHOW FULL COLUMNS" (6% of queries) coming to 17.17ms out of 231.9ms on a test run I did (7.4% of query time).

 

If you're using JTable, override the getFields method and return that. APC will cache and optimise it and it likely won't change very often that updating it will be a burden. It used to be this way but someone decided that it was better for every single page load to ask the same question than to have the developer do it once.

 

5% performance boost from database couldn't be easier. Remember, all magic comes with a price.
Replies
Tobias
Tobias Hi Sam

Did you get any feedback on this? I see the same or worse in my profiling. Could you share your customization?
9 years ago
loader
loader
Attachment

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW