?
avatar delfweb
delfweb
6 Dec 2014

Hi,

Every time when we call

JLayoutHelper::render('path.tp.layout');

or real code from admin area

$layout = new JLayoutFile('joomla.toolbar.title');
$html   = $layout->render(array('title' => $title, 'icon' => $icon));

then JLayoutFile object running refreshIncludePaths method 3 times not depending from any condition:

  • 2 times from constuctor
  • once from JLayoutFile::getPaths(). If you look to refreshIncludePaths it is most heavy method in class.

As a result if we want to display just 4 lines of admin title

<h1 class="page-title">
    <span class="icon-<?php echo $icon; ?>"></span>
    <?php echo $displayData['title']; ?>
</h1>

we spend 3-5% of total time. In my server it is 4-5ms what is a lot. Sugest to rework this engine at the beginning and make more efficiant.

avatar delfweb delfweb - open - 6 Dec 2014
avatar jissues-bot jissues-bot - change - 6 Dec 2014
Labels Added: ?
avatar dgt41
dgt41 - comment - 6 Dec 2014

Are you using cache in your site?
Check this: http://phproberto.com/en/blog/21-joomla-rendering-benchmarks

avatar delfweb
delfweb - comment - 6 Dec 2014

I have seen this article. System file access it is not what i mean. Layout engine slow itself because make a lot of preparations and in most cases thay are repeated. If you use the same layout 10 times then all operations repeated 10 time as if was used first time. At least i don't see code which reuse the same layout. And why is it calling refreshIncludePaths methos 3 times?

avatar dgt41
dgt41 - comment - 6 Dec 2014

Since there is a pending PR #3231 for improvements on layouts, would you like to address there your concerns?

avatar delfweb
delfweb - comment - 6 Dec 2014

yes, it is what is really need

avatar delfweb delfweb - close - 6 Dec 2014
avatar delfweb delfweb - change - 6 Dec 2014
The description was changed
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-12-06 18:23:13

Add a Comment

Login with GitHub to post a comment