MantisBT: master-2.0.x 6ec8cc63

Author Committer Branch Timestamp Parent
dregadmin dregadmin master-2.0.x 2013-05-01 06:49 master-2.0.x 1978c7e5
Affected Issues  0009876: Performance problem with a lot of projects
Changeset

Optimize user_get_all_accessible_projects()

On instances having a large number of projects, this function would
consume significant resources while processing all the subprojects to
determine if one is accessible to the user (about 25 seconds to load
main_page.php for 5'000 projects, without subprojects).

The performance bottleneck was the array_merge() call in the loop. This
has been replaced by a foreach working on an associative array. The same
page now loads under 1 second.

Fixes 0009876

mod - core/user_api.php Diff File