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

  I found "cook" two days ago. Played around with it for a day and then within a day got rid of two legacy applications in IBM Lotus Domino Notes and replaced them with "cook". It was really easy. A piece of cake. Actually it was even easier than cooking. Cooking involves more work than developing with "cook". What can I say about "cook"? Great application great price for what it delivers great forum with a lot of information and fast responses active and friendly community fast forward moving development cycle So what should I say "Monsieur Le Cook"? Keep the good work going it will lead to success. Having become a paying member in the words of Edith Piaf may I say ..... non rien de rien ... je ne regrette rien. Vive La France.
FK (JED)
         

Get Started