my thoughts about how improve performances on jcook-generated components:
- remove the dom FLY, use the simple plain item value, example:
replace all the (EXAMPLE CODE):
<?php echo JDom::_('html.fly', array(
'dataKey' => 'title',
'dataObject' => $row
));?>
with (EXAMPLE CODE):
<?php echo $row->title; ?>
why?
- mainly for better performances on long list and less server resources usage, because the jdom is not involved on this code
- better code view
replace all the enumlist output (EXAMPLE CODE):
<?php echo JDom::_('html.fly.enum', array(
'dataKey' => 'type',
'dataObject' => $row,
'labelKey' => 'text',
'list' => ComponentHelper::enumList('fields', 'type'),
'listKey' => 'value'
));?>
with (EXAMPLE CODE):
<?php echo $this->lists['enum']['fields.type'][$row->type]['text']; ?>
why?
- the function "ComponentHelper::enumList" is called just ONCE in the view.html.php and then used for all the rows, instead of call the function N rows times. I know the function doesn't requires a lot of resources (if not modified) but it's still prefereable to avoid to call it N times for the same values.
- better performances on long list and less server resources usage, because the jdom is not involved on this code
- better code view