-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Performance optimizations #1 #12171
Performance optimizations #1 #12171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good from here. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO is_file
should be the last check sine it makes I/O call to the filesystem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, missed that one. Nice catch.
libraries/cms/html/tabs.php
Outdated
@@ -9,6 +9,7 @@ | |||
|
|||
defined('JPATH_PLATFORM') or die; | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remvoe this extra line
|
||
if ($appProperty->isPrivate() === false && is_null($this->app)) | ||
if ($reflection->getProperty('app')->isPrivate() === false && $this->app === null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the order of the conditions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
|
||
if ($dbProperty->isPrivate() === false && is_null($this->db)) | ||
if ($reflection->getProperty('db')->isPrivate() === false && $this->db === null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -192,7 +192,7 @@ public static function menuItemList($name, $selected = null, $attribs = null, $c | |||
'select.genericlist', $options, $name, | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses. Should I report them here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's just the right place ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got more? Shall I wait?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also align =
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More reported and I am done for now. 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Done a few more things I found along the way.
@@ -451,7 +451,7 @@ public function getPagesLinks() | |||
public function getPaginationLinks($layoutId = 'joomla.pagination.links', $options = array()) | |||
{ | |||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses and more below.
@@ -127,12 +127,12 @@ public function getSha1($jsonData, JTableContenttype $typeTable) | |||
// Go one level down for JSON column values | |||
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
} | ||
} | ||
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
+ 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.