Performance Issues v1.97 - 2.0 with list screens [message #5923] |
Sat, 01 October 2016 23:22 ![Go to next message Go to next message](/theme/default/images/down.png) |
renato
Messages: 4 Registered: October 2016
|
Junior Member |
|
|
Hi Tony,
I'm getting performance issues in list views and multi5 views. Some LIST1 screens taking as much as 21 seconds to render (when showing 100 records) and 5 seconds for 25 lines
I narrowed it down to this peace of code in 'include.xml.php5.inc' -> addData2XMLdoc:
if ($spec['control'] == 'popup') {
if (!array_key_exists($fieldname, $screen_fields)) {
// field does not exist in this screen, so skip next bit
} else {
$child->setAttribute('control', 'popup');
if (isset($spec['foreign_field'])) {
$child->setAttribute('foreign_field', $spec['foreign_field']);
} // if
if (isset($spec['task_id'])) {
if (!empty($dbobject->zone) AND $dbobject->zone != 'main') {
// include zone name in task_id
$zone = 'db'.$dbobject->zone;
$child->setAttribute('task_id', "task#{$zone}#{$spec['task_id']}");
} else {
$child->setAttribute('task_id', "task#{$spec['task_id']}");
} // if
$taskOBJ =& RDCsingleton::getInstance('mnu_task');
$task_data = $taskOBJ->getData("task_id='{$spec['task_id']}'"); // <------------- Line causing performance problems
if(!empty($task_data)) {
$task_data = $task_data[0];
$child->setAttribute('tooltip', $task_data['task_desc']);
} //if
} // if
if (isset($spec['allow_input'])) {
$child->setAttribute('allow_input', $spec['allow_input']);
} // if
} // if
} // if
If I comment that line rendering goes down to 1.2 seconds for 100 records.
And down to 0.7 seconds when showing 25 records.
The table I'm testing on contains 5 popups for the insert/update screen.
If I change it to getData_raw it's still 8 seconds for 100 records. (a bit better).
What's the purpose of doing that database call? Just for the tooltip?
Shouldn't this be done only for ADD/Update/MULTI screens? not for LIST1/LIST2
I think that extra database call causes the delay in list screens.
Will something else break if I comment that line for now?
|
|
|
Re: Performance Issues v1.97 - 2.0 with list screens [message #5924 is a reply to message #5923] |
Sun, 02 October 2016 05:48 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
AJM
Messages: 2361 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
If you look at that code you should see the following lines:
if (!array_key_exists($fieldname, $screen_fields)) {
// field does not exist in this screen, so skip next bit
} else {
The variable $screen_fields identifies all the fields from the current entity which are displayed in the current screen, so if a popup field is contained on the current screen then it will execute the code which obtains the tooltip for that field.
Do you have any of these popup fields shown in the LIST area?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|
|