Mantis Bugtracker 

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008424TestLinkTest Plan (builds, milestones, test assign)public2018-10-22 16:312018-10-24 18:11
Assigned Tofman 
PlatformOSOS Version
Product Version 
Fixed in Version 
Summary0008424: Performance problems in buildEdit.php (200 builds with 5000 assignments)

200 builds with 5000 assignments

I detected serious performance problem in buildEdit.php.

In function renderGui we have switch like:
      case "do_create":
        $doRender = true;

And after that:
      // Attention this is affected by changes in templates

Why we get builds at this action?

I think we should get list of build only in case of refreshing list after update/delete/create action. But not in case of click on "Create build" button.

For example, if we have huge amount of builds in TestPlan click on "Create build" button work about 5min before form of creation new build open.

TagsNo tags attached.
Database (MySQL,Postgres,etc)MySQL
PHP Version
QA Team - Task Workflow StatusTBD
Attached Files

- Relationships

-  Notes
fman (administrator)
2018-10-22 16:58

Subject is misleading, because no good context has been provided
what do you mean for huge amount of builds ? 100,1000,10000

This information is critic to understand why you are getting this performance issue.

I'm going to recheck to have the right answer to this change.
fman (administrator)
2018-10-22 18:07
edited on: 2018-10-22 18:14

When you create a new build you have the option to copy tester assignments, in order to do this you need a list of available builds.

may be this today can be solved with an ajax call in order to do the call ONLY if users request the copy

it will be interesting to understand if issue is related to natsort PHP function
in order to understand this, all you need to do is comment the call in
testplan.class.php method get_builds()

fman (administrator)
2018-10-22 18:17

try also with this changes in (always in testplan.class.php)

function _natsort_builds($builds_map) {
    // sort in natural order (see natsort in PHP manual)
    foreach($builds_map as $key => $value) {
      $build_names[$key] = $value['name'];
    foreach($build_names as $key => $value) {
      $dummy[$key] = $builds_map[$key];
    return $dummy;
kanaduchi (reporter)
2018-10-23 05:16

Yes, this helps a bit.

But I found main reason of performance issue.

In the form of creation of new build we have checkpoint "Copy tester assignments"

And in buildEdit.php we have method init_source_build_selector where 2 actions:
1. Get list of build names
2. Get all testers assignments for every build ($count = $testplan_mgr->assignment_mgr->get_count_of_assignments_for_build_id($key))

In my case I have 200 builds with 5000 assignments in every build. In that case script execution hangs on this point.

I remove this problem by commented this line -
//$count = $testplan_mgr->assignment_mgr->get_count_of_assignments_for_build_id($key)
(I disabled counting of assignments).

But is not the solution... And currently I don't know how to solve performance issue without disable this functionality
kanaduchi (reporter)
2018-10-23 05:20
edited on: 2018-10-23 05:21

Also I notice interesting situation. When we click on Create new build button we go to renderGui:
      case "create":
        $doRender = true;
and after that in render option we do get_builds($argsObj->tplan_id);

But next in method init_source_build_selector we get builds again:
  $htmlMenu['items'] = $testplan_mgr->get_builds_for_html_options($argsObj->tplan_id,null,null,array('orderByDir' => 'id:DESC'));

So in action of clicking on creation new build button we get builds twice

fman (administrator)
2018-10-24 18:11

going to check.

- Issue History
Date Modified Username Field Change
2018-10-22 16:31 kanaduchi New Issue
2018-10-22 16:58 fman Note Added: 0028064
2018-10-22 16:58 fman Assigned To => fman
2018-10-22 16:58 fman Status new => feedback
2018-10-22 18:07 fman Note Added: 0028070
2018-10-22 18:08 fman Note Edited: 0028070 View Revisions
2018-10-22 18:14 fman Note Edited: 0028070 View Revisions
2018-10-22 18:17 fman Note Added: 0028071
2018-10-23 05:16 kanaduchi Note Added: 0028072
2018-10-23 05:16 kanaduchi Status feedback => assigned
2018-10-23 05:20 kanaduchi Note Added: 0028073
2018-10-23 05:21 kanaduchi Note Edited: 0028073 View Revisions
2018-10-24 18:11 fman Note Added: 0028087
2018-10-24 18:11 fman QA Team - Task Workflow Status => TBD
2018-10-24 18:11 fman Summary Performance problems in buildEdit.php => Performance problems in buildEdit.php (200 builds with 5000 assignments)
2018-10-24 18:11 fman Description Updated View Revisions

Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker