View Issue Details

IDProjectCategoryView StatusLast Update
0015347mantisbtperformancepublic2013-02-01 18:53
Reporterdregad Assigned Todregad  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionduplicate 
Product Version1.2.13 
Summary0015347: Bad performance and memory issue with print_user_option_list
Description

While benchmarking performance for 0013680 with a test DB having about 20'000 records in mantis_user_table, I noticed that the adm_config_report.php page would not load at all (blank page).

I was surprised to find no errors in PHP logs, but after a bit of research I traced it to the call to print_user_option_list() in the edit form at page bottom.

When "All Projects" is selected, that function calls project_get_all_user_rows() several times (once for each project the current user has access to, which in fact generally means all projects since the user loading the page is most likely an administrator)

The code in project_get_all_user_rows() does not efficiently handle this situation, because every time the function is called it

  • loads all "global" users
  • loads any project overrides
  • populates the user cache with the results
  • returns the array values to caller (so we can't even use it as a map in later calls)

This not only results in heavy memory usage, but also causes bad performance as each execution of the function required about 1-2 second on my test system (with 16 projects), sometimes causing the page execution to abort (PHP Fatal error: Maximum execution time exceeded).

This code should be optimized.

TagsNo tags attached.

Relationships

duplicate of 0015411 closeddregad Huge memory consumption for print_user_option_list() 
related to 0013680 closeddregad Configuration page takes a very long time to load 
related to 0014559 closeddregad Adding filter for "Configuration report" 

Activities

dregad

dregad

2013-01-22 20:42

developer   ~0034866

That will teach me to work so late in the night, opening a duplicate for an issue I had already created just a few days before :-/