View Issue Details

IDProjectCategoryView StatusLast Update
0010170mantisbtperformancepublic2009-06-23 15:28
ReporterSAnDAnGE Assigned Tograngeway  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0a3 
Target Version1.2.0rc1Fixed in Version1.2.0rc1 
Summary0010170: MantisEnum class is inefficient when dealing with more than a few tuples
Description

If there are several statuses set in mantis, accessing http://localhost/mantis120a3/manage_config_workflow_page.php proves impossible, as it takes a lot longer than 60 seconds to load.

Steps To Reproduce

1) Add in mantis statuses and a workflow similar to:

a:47:{i:10;s:50:"11:Queue 1st,22:Queue 2nd,35:Queue 3rd,47:Queue QA";i:11;s:55:"12:In Process by 1st,54:Feedback Requested by 1st to QA";i:12;s:80:"14:Awaiting approval by 1st,13:On Hold by 1st,54:Feedback Requested by 1st to QA";i:13;s:55:"12:In Process by 1st,54:Feedback Requested by 1st to QA";i:14;s:79:"15:Approved by 1st,16:Rejected 1st,54:Feedback Requested by 1st to QA,90:closed";i:15;s:47:"22:Queue 2nd,54:Feedback Requested by 1st to QA";i:16;s:65:"12:In Process by 1st,54:Feedback Requested by 1st to QA,90:closed";i:17;s:34:"31:Feedback Provided by 1st to 2nd";i:18;s:33:"57:Feedback Provided by 1st to QA";i:19;s:51:"11:Queue 1st,12:In Process by 1st,13:On Hold by 1st";i:21;s:60:"90:closed,54:Feedback Requested by 1st to QA,61:Review by QA";i:22;s:91:"23:In process by 2nd,17:Feedback Requested by 2nd to 1st,55:Feedback Requested by 2nd to QA";i:23;s:116:"25:Awaiting approval by 2nd,17:Feedback Requested by 2nd to 1st,24:On Hold by 2nd,55:Feedback Requested by 2nd to QA";i:24;s:91:"23:In process by 2nd,17:Feedback Requested by 2nd to 1st,55:Feedback Requested by 2nd to QA";i:25;s:115:"26:Approved by 2nd,17:Feedback Requested by 2nd to 1st,27:Rejected 2nd,55:Feedback Requested by 2nd to QA,90:closed";i:26;s:83:"35:Queue 3rd,17:Feedback Requested by 2nd to 1st,55:Feedback Requested by 2nd to QA";i:27;s:101:"23:In process by 2nd,17:Feedback Requested by 2nd to 1st,55:Feedback Requested by 2nd to QA,90:closed";i:28;s:34:"43:Feedback Provided by 2nd to 3rd";i:29;s:33:"58:Feedback Provided by 2nd to QA";i:31;s:51:"22:Queue 2nd,23:In process by 2nd,24:On Hold by 2nd";i:32;s:51:"22:Queue 2nd,23:In process by 2nd,24:On Hold by 2nd";i:33;s:50:"61:Review by QA,45:Solution Rejected by 2nd to 3rd";i:34;s:50:"61:Review by QA,45:Solution Rejected by 2nd to 3rd";i:35;s:91:"36:In process by 3rd,28:Feedback Requested by 3rd to 2nd,56:Feedback Requested by 3rd to QA";i:36;s:116:"38:Awaiting approval by 3rd,28:Feedback Requested by 3rd to 2nd,37:On Hold by 3rd,56:Feedback Requested by 3rd to QA";i:37;s:91:"36:In process by 3rd,28:Feedback Requested by 3rd to 2nd,56:Feedback Requested by 3rd to QA";i:38;s:115:"39:Approved by 3rd,28:Feedback Requested by 3rd to 2nd,41:Rejected 3rd,56:Feedback Requested by 3rd to QA,90:closed";i:39;s:105:"34:Solution Provided by 3rd to 2nd,28:Feedback Requested by 3rd to 2nd,56:Feedback Requested by 3rd to QA";i:41;s:91:"36:In process by 3rd,28:Feedback Requested by 3rd to 2nd,56:Feedback Requested by 3rd to QA";i:42;s:33:"59:Feedback Provided by 3rd to QA";i:43;s:51:"35:Queue 3rd,36:In process by 3rd,37:On Hold by 3rd";i:44;s:51:"35:Queue 3rd,36:In process by 3rd,37:On Hold by 3rd";i:45;s:91:"36:In process by 3rd,28:Feedback Requested by 3rd to 2nd,56:Feedback Requested by 3rd to QA";i:46;s:91:"36:In process by 3rd,28:Feedback Requested by 3rd to 2nd,56:Feedback Requested by 3rd to QA";i:47;s:124:"48:In process by QA,18:Feedback Requested by QA to 1st,29:Feedback Requested by QA to 2nd,42:Feedback Requested by QA to 3rd";i:48;s:148:"49:On Hold by QA,18:Feedback Requested by QA to 1st,29:Feedback Requested by QA to 2nd,42:Feedback Requested by QA to 3rd,51:Awaiting approval by QA";i:49;s:124:"48:In process by QA,18:Feedback Requested by QA to 1st,29:Feedback Requested by QA to 2nd,42:Feedback Requested by QA to 3rd";i:51;s:147:"52:Approved by QA,18:Feedback Requested by QA to 1st,29:Feedback Requested by QA to 2nd,42:Feedback Requested by QA to 3rd,53:Rejected QA,90:closed";i:52;s:121:"21:Review by 1st,18:Feedback Requested by QA to 1st,29:Feedback Requested by QA to 2nd,42:Feedback Requested by QA to 3rd";i:53;s:124:"48:In process by QA,18:Feedback Requested by QA to 1st,29:Feedback Requested by QA to 2nd,42:Feedback Requested by QA to 3rd";i:54;s:33:"19:Feedback Provided by QA to 1st";i:55;s:33:"32:Feedback Provided by QA to 2nd";i:56;s:33:"44:Feedback Provided by QA to 3rd";i:57;s:64:"47:Queue QA,48:In process by QA,49:On Hold by QA,61:Review by QA";i:58;s:64:"47:Queue QA,48:In process by QA,49:On Hold by QA,61:Review by QA";i:59;s:64:"47:Queue QA,48:In process by QA,49:On Hold by QA,61:Review by QA";i:61;s:184:"47:Queue QA,18:Feedback Requested by QA to 1st,29:Feedback Requested by QA to 2nd,33:Solution Rejected by QA to 2nd,42:Feedback Requested by QA to 3rd,46:Solution Rejected by QA to 3rd";}

2) Access manage_config_workflow_page.php

Additional Information

A solution to this choking problem would be to modify the MantisEnum::getAssocArrayIndexedByValues( $enumString ) function as follows:

/*

  • @var array Used to cache previous results
    */
    private static $_cacheAssocArrayIndexedByValues = array();

Modify the getAssocArrayIndexedByValues function:

public static function getAssocArrayIndexedByValues( $enumString ) {
foreach (self::$_cacheAssocArrayIndexedByValues as $cache) {
if ($cache['id'] == $enumString) {
return $cache['value'];
}
}

    ...

    $cache = array();
    $cache['id'] = $enumString;
    $cache['value'] = $assocArray;
    self::$_cacheAssocArrayIndexedByValues[] = $cache;

    return $assocArray;
}
TagsNo tags attached.

Activities

jreese

jreese

2009-02-27 15:50

reporter   ~0020959

Could you provide us with a patch that we can apply to our repository? Instructions can be found in the developers' guide:

http://docs.mantisbt.org/master/en/developers/dev.contrib.html
http://docs.mantisbt.org/master/en/developers/dev.contrib.submit.html

Thank you.

rhurtik

rhurtik

2009-03-10 09:52

reporter   ~0021022

Hi Guys
I couldn't locate the concerned code.
I've greped the Mantis svn Revision: 5752 as foloving
grep 'public static function' * -Rn

There is no output for getAssocArrayIndexedByValues.
Is this issue still actual?

jreese

jreese

2009-03-11 10:39

reporter   ~0021033

@Rhurtik: We no longer use Subversion for our source control. we switched to using Git many months ago. Please see http://git.mantisbt.org and http://www.mantisbt.org/development.php

grangeway

grangeway

2009-04-08 15:04

reporter   ~0021448

Fix commited to trunk, thanks