Performance optimizations #1#12171
Performance optimizations #1#12171rdeutz merged 48 commits intojoomla:stagingfrom frankmayer:Performance_1
Conversation
zero-24
left a comment
There was a problem hiding this comment.
looks good from here. Thanks!
zero-24
left a comment
There was a problem hiding this comment.
Please have a look at: https://travis-ci.org/joomla/joomla-cms/jobs/162592381 It looks like travis is not happy.
|
Travis error is: |
|
Yes, I noticed... :) Will fix errors. |
|
on it... |
andrepereiradasilva
left a comment
There was a problem hiding this comment.
some minor comments
libraries/cms/helper/media.php
Outdated
| { | ||
| if (substr($entry, 0, 1) !== '.' && is_file($dir . DIRECTORY_SEPARATOR . $entry) | ||
| if ($entry[0] !== '.' && is_file($dir . DIRECTORY_SEPARATOR . $entry) | ||
| && strpos($entry, '.html') === false && strpos($entry, '.php') === false) |
There was a problem hiding this comment.
IMO is_file should be the last check sine it makes I/O call to the filesystem.
There was a problem hiding this comment.
Yes, missed that one. Nice catch.
libraries/cms/html/tabs.php
Outdated
|
|
||
| defined('JPATH_PLATFORM') or die; | ||
|
|
||
|
|
There was a problem hiding this comment.
please remvoe this extra line
| $appProperty = $reflection->getProperty('app'); | ||
|
|
||
| if ($appProperty->isPrivate() === false && is_null($this->app)) | ||
| if ($reflection->getProperty('app')->isPrivate() === false && $this->app === null) |
There was a problem hiding this comment.
change the order of the conditions?
| $dbProperty = $reflection->getProperty('db'); | ||
|
|
||
| if ($dbProperty->isPrivate() === false && is_null($this->db)) | ||
| if ($reflection->getProperty('db')->isPrivate() === false && $this->db === null) |
There was a problem hiding this comment.
change the order of the conditions?
|
I have tested this item ✅ successfully on 171f66b This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12171. |
|
Just an idea... |
|
@peteruoi that is an interesting idea. However I assume that any improvements from all the PRs will vary a lot with mileage. Unfortunately I haven't got the time to set this up and do the tests. Another situation where I would hope to see some measurable optimization would be, if the indexer performance PR would be merged (see #13511). |
libraries/cms/html/menu.php
Outdated
| array( | ||
| 'id' => isset($config['id']) ? $config['id'] : 'assetgroups_' . (++$count), | ||
| 'list.attr' => (is_null($attribs) ? 'class="inputbox" size="1"' : $attribs), | ||
| 'list.attr' => ($attribs === null ? 'class="inputbox" size="1"' : $attribs), |
There was a problem hiding this comment.
Remove parentheses. Should I report them here?
There was a problem hiding this comment.
Yes, that's just the right place ;)
There was a problem hiding this comment.
Got more? Shall I wait?
There was a problem hiding this comment.
More reported and I am done for now. 😉
There was a problem hiding this comment.
Thanks. Done a few more things I found along the way.
| { | ||
| // Allow to receive a null layout | ||
| $layoutId = (null === $layoutId) ? 'joomla.pagination.links' : $layoutId; | ||
| $layoutId = ($layoutId === null) ? 'joomla.pagination.links' : $layoutId; |
There was a problem hiding this comment.
Remove parentheses and more below.
| foreach ($value as $subName => $subValue) | ||
| { | ||
| $object->$subName = (is_int($subValue) || is_bool($subValue) || is_null($subValue)) ? (string) $subValue : $subValue; | ||
| $object->$subName = (is_int($subValue) || is_bool($subValue) || $subValue === null) ? (string) $subValue : $subValue; |
| else | ||
| { | ||
| $object->$name = (is_int($value) || is_bool($value) || is_null($value)) ? (string) $value : $value; | ||
| $object->$name = (is_int($value) || is_bool($value) || $value === null) ? (string) $value : $value; |
+ a few more changes found last minute
…ld have been an integer...
|
Bump @andrepereiradasilva & @Quy Problem solved. Pls test (review changes) to go for RTC |
|
I have tested this item ✅ successfully on 171f66b This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12171. |
|
@peteruoi when we have levels like Joomla server side performance things are not like 30% Faster in all Pages. Is really relative to each change and to the amount of scenarios that change apllies to Imo the most important performance improvements are the ones done to the critical page that apllies to all pages and also most used parts (com_content, jroute, etc). |
|
I have tested this item ✅ successfully on 171f66b This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12171. |
|
RTC after two successful tests. |
|
@andrepereiradasilva Even with a 5% percent general it will be awesome news for advertisment for 3.8 campaign. And no one forbids us to say 5% to 20% (at miltilingual for example). |
|
Hooray, this really big chunk was finally merged! Thank you all for your comments and efforts in testing |
[UPDATED (5.1.2017) - see second paragraph]
Those are some performance optimizations for the libraries/cms folder. If you like those, there are plenty more where those came from.
Since I don't know if you guys are open to these kinds of PR's. I am awaiting the developments of my open PR's before I do more.
[Update 5.1.2017]
In order to lighten this PR up, I have introduced 6 sub-PRs, which are easier to digest and mostly with very specific changes. In order to continue with this one, those ones should be tested/reviewed/merged first. After that, I can resolve the conflicts and there should finally be only a few changes left.