Persona is no longer an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 917370 - large dependency trees are very slow to load
: large dependency trees are very slow to load
: perf
Product: Bugzilla
Classification: Server Software
Component: Dependency Views (show other bugs)
: unspecified
: All All
: -- normal (vote)
: Bugzilla 4.4
Assigned To: Byron Jones ‹:glob›
: default-qa
Depends on:
  Show dependency treegraph
Reported: 2013-09-17 09:20 PDT by Byron Jones ‹:glob›
Modified: 2013-10-23 16:21 PDT (History)
3 users (show)
mail: approval+
mail: approval4.4+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---

917370_1.patch (5.21 KB, patch)
2013-09-17 11:35 PDT, Byron Jones ‹:glob›
LpSolit: review-
Details | Diff | Splinter Review
917370_2.patch (4.77 KB, patch)
2013-09-17 21:46 PDT, Byron Jones ‹:glob›
dkl: review-
Details | Diff | Splinter Review
screen shot showing duplicate dependencies for one bug (228.46 KB, image/png)
2013-09-27 14:55 PDT, David Lawrence [:dkl]
no flags Details
917370_3.patch (5.77 KB, patch)
2013-10-01 00:03 PDT, Byron Jones ‹:glob›
dkl: review+
Details | Diff | Splinter Review

Description Byron Jones ‹:glob› 2013-09-17 09:20:05 PDT
the dependency tree on bug 841999 is slow to the point of being useless (just took 45 seconds to load).

i suspect we can do better.
Comment 1 Byron Jones ‹:glob› 2013-09-17 11:35:54 PDT
Created attachment 806146 [details] [diff] [review]

there were two major problems with the old code performance-wise:
- it always generated bugs for the complete tree, regardless of max-depth
- it created bug objects one-by-one instead of using new_from_list

this patch greatly improves performance for bugs with deep dependency trees.
Comment 2 Frédéric Buclin 2013-09-17 11:44:15 PDT
Comment on attachment 806146 [details] [diff] [review]

>-local our $hide_resolved = $cgi->param('hide_resolved') ? 1 : 0;
>-local our $maxdepth = $cgi->param('maxdepth') || 0;
>-if ($maxdepth !~ /^\d+$/) { $maxdepth = 0 };
>+my $hide_resolved = $cgi->param('hide_resolved') ? 1 : 0;
>+my $maxdepth = $cgi->param('maxdepth') || 0;

You cannot use "my" and then use these variables inside subroutines (unless you pass them as parameters), see bug 348923.
Comment 3 Byron Jones ‹:glob› 2013-09-17 21:46:14 PDT
Created attachment 806429 [details] [diff] [review]

oops, thanks for catching that lpsolit.  that script is in need of a rewrite, but not today.
Comment 4 David Lawrence [:dkl] 2013-09-27 14:54:25 PDT
Comment on attachment 806429 [details] [diff] [review]

Review of attachment 806429 [details] [diff] [review]:

I am getting a lot of duplicates lines within the same block when going above depth of 5 or so. On your bmo/4.2 devel system, place the patched showdependencytree.cgi from trunk over the bmo copy.
Then view showdependencytree.cgi?id=841999&hide_resolved=1 and you will see what I mean. I will also attach a screenshot. dkl
Comment 5 David Lawrence [:dkl] 2013-09-27 14:55:08 PDT
Created attachment 811388 [details]
screen shot showing duplicate dependencies for one bug
Comment 6 Byron Jones ‹:glob› 2013-10-01 00:03:33 PDT
Created attachment 812476 [details] [diff] [review]
Comment 7 David Lawrence [:dkl] 2013-10-01 12:58:07 PDT
Comment on attachment 812476 [details] [diff] [review]

Review of attachment 812476 [details] [diff] [review]:

r=dkl with fix on checkin.

::: showdependencytree.cgi
@@ +136,5 @@
>  }
> +
> +sub _get_dependencies {
> +    my ($bug_id, $relationship) = @_;
> +    my $cache = Bugzilla->request_cache->{dependency_cache};

Change the above line to:

my $cache = Bugzilla->request_cache->{dependency_cache} ||= {};

Otherwise, it would time out and the page never loaded for me.
Comment 8 Frédéric Buclin 2013-10-11 15:17:27 PDT
Should be committed asap (with the fix on checkin) as we plan to release on Tuesday.
Comment 9 Byron Jones ‹:glob› 2013-10-15 07:03:22 PDT
Committing to: bzr+ssh://
modified showdependencytree.cgi
Committed revision 8619.

Committing to: bzr+ssh://
modified showdependencytree.cgi
Committed revision 8773.
Comment 10 Asa Dotzler [:asa] 2013-10-23 16:21:37 PDT
AWESOME!!!  This is so much better now. Thank you all for your quick attention and for the great fix!

Note You need to log in before you can comment on or make changes to this bug.