Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Jdom: improving performances 12 Jun 2013 07:20 #7446

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?
  1. mainly for better performances on long list and less server resources usage, because the jdom is not involved on this code
  2. 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?
  1. 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.
  2. better performances on long list and less server resources usage, because the jdom is not involved on this code
  3. better code view

Please Log in or Create an account to join the conversation.

Re: Jdom: improving performances 18 Jun 2013 16:29 #7564

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
You are right.

The simple html.fly seems to do nothing. Right.

But when you add some parameters :
responsive, aclAccess, etc... then you can can the visibility depending of the rights or the screen size.
It is only an example.

When you want to optimize your component, you can replace critical JDom call to their optimized code.
For example in huges lists it is better to optimize, removing JDom for the grid rows.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.078 seconds

Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs. 

One word: Awesome.
Edwardcox (JED)
         

Get Started