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.402 seconds

Freakin' Awesome!!! J-Cook is simply awesome - whether you're a highly experienced developer or complete novice whether you're building a small inventory component or a complete community solution! The beauty comes from a fast slick and reliable platform that readily provides developers with everything they'll need to build the backbone of a solid and secure component with wizards for authoring access publishing aliasing created/modified by dates... you name it COOK provides it! J-Cook really surpasses all of the 'competition' as far as MVC tools are concerned! Try love it and get cooking!
learnthrusong (JED)
          

Get Started