Bug 458696 - Filing a bug against Fedora is cripplingly slow
Filing a bug against Fedora is cripplingly slow
Status: CLOSED NEXTRELEASE
Product: Bugzilla
Classification: Community
Component: Bugzilla General (Show other bugs)
devel
All Linux
high Severity medium (vote)
: ---
: ---
Assigned To: Noura El hawary
:
: 254010 460286 (view as bug list)
Depends On:
Blocks: 474289
  Show dependency treegraph
 
Reported: 2008-08-11 13:03 EDT by Adam Jackson
Modified: 2013-06-24 00:06 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-26 21:48:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
new patch for using ajax to load component flags to enter_bug.cgi (4.21 KB, patch)
2009-01-20 01:19 EST, Noura El hawary
no flags Details | Diff
process component desc and flags to enter bug using ajax (4.95 KB, patch)
2009-01-22 23:20 EST, Noura El hawary
no flags Details | Diff
process component desc and flags to enter bug using ajax (dkl) (7.38 KB, patch)
2009-01-23 00:14 EST, David Lawrence
no flags Details | Diff
using ajax for component flags and description in enterbug (8.44 KB, patch)
2009-01-23 04:53 EST, Noura El hawary
dkl: review-
Details | Diff

  None (edit)
Description Adam Jackson 2008-08-11 13:03:41 EDT
Description of problem:

Firebug says the initial GET of https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora takes 57 seconds.  Compared to ?product=Bugzilla, which is more like 1.6 seconds, so it's likely to be something linearly related to the number of components in a product, and being computed afresh on the server every time.

Firebug, for reference, is a firefox debugging plugin that allows you to interactively inspect web page performance and correctness.  It can be had from here:

https://addons.mozilla.org/firefox/addon/1843

Note that network debugging is disabled by default, so you'll need to turn it on.
Comment 1 David Lawrence 2008-08-25 23:03:48 EDT
We have disabled the javascript helper code in the enter_bug.cgi page that displays the summary and pre-fills the default assigned to value. Since Fedora has 6000+ components, this page was not originally designed to handle that many components. It should display quicker for you now.

We will have to visit this issue soon and maybe come up with a different solution to replace the help code that is disabled. Maybe ajax for displaying the component description, assigned_to, etc.

Dave
Comment 2 Max Kanat-Alexander 2008-09-03 19:47:33 EDT
*** Bug 460286 has been marked as a duplicate of this bug. ***
Comment 3 David Lawrence 2008-11-24 15:26:40 EST
The enter_bug.cgi page and several others are still slower in 3.2 due to the large number of components. We really need to fix the issue with large component lists to enhance the user experience.
Comment 8 Noura El hawary 2009-01-20 01:19:00 EST
Created attachment 329427 [details]
new patch for using ajax to load component flags to enter_bug.cgi

Hey Dave,

Here is another patch that will fix the error you were getting with firebug when the page first loads, regarding making a separate function to return the component flags, i actually thought about this solution but then I found that the return value from that separate function will be pretty much identical with what we have in Component.get we will still need to return component name/id and product info as well so we can relate component to flags so i thought i would just add it to the Component.get , also you said it will be good to have the component description returned to display it at bug entry time, so only difference will be in the assignee/qa contact/ cc list , if we still want to limit the return to not have those extra user information then we can pass the return_flags_only param. I will login later to discuss some more with you.

Thanks,
Noura
Comment 9 Noura El hawary 2009-01-22 23:20:40 EST
Created attachment 329774 [details]
process component desc and flags to enter bug using ajax
Comment 10 David Lawrence 2009-01-23 00:14:11 EST
Created attachment 329777 [details]
process component desc and flags to enter bug using ajax (dkl)

Hey Noura. I moved the code that does the comp description and flag fields changes to the "success" part of the ajax callback. This basically does all of the work when the data is successfully returned from the call to Component.get().

But it basically works now. You could clean it up by making a separate function that does the actual form field updating so that it can be called from within the sucess part of the ajax call back or in other parts of the code.

For example the js code in create.html.tmpl could first check to see if the flags[index] is already populated before calling get_component_flags() so we are not making ajax calls for components that have already been selected before.

Let me know if you have any questions.
Dave
Comment 11 Noura El hawary 2009-01-23 04:53:02 EST
Created attachment 329786 [details]
using ajax for component flags and description in enterbug

Thanks for your help Dave, attached is a last version with the cleanup you suggested so now we only make one xmlrpc call perl for selected component, the patch is applied to bz-web2 and seems to be working nicely, also the loaded data now for fedora enterbug page is 72KB which is much better than before and the bug reporter works nicely no script errors and it doesn't hang.

Noura
Comment 12 David Lawrence 2009-01-23 11:07:25 EST
Comment on attachment 329786 [details]
using ajax for component flags and description in enterbug

>Index: Bugzilla/WebService/Component.pm
>                 default_qa_contact =>
>                     type('string')->value( $_->default_qa_contact->{login_name} ),
>                 default_cc => [ map $_->login, @{ $_->initial_cc } ],
>+                flags => _get_component_flags($_), 
>             }
>             } @$accessible_components;
>     }
>@@ -287,6 +288,23 @@ sub _get_accessible_components {
>     return \@accessible_components;
> }
> 
>+sub _get_component_flags {
>+    my $comp_obj = $_;
>+
>+    my @flag_list;
>+
>+    foreach my $f (@{$comp_obj->flag_types->{bug}}) {
>+        next unless $f->is_active;
>+        push @flag_list, $f->id;
>+    }
>+    foreach my $f (@{$comp_obj->flag_types->{attachment}}) {
>+        next unless $f->is_active;
>+        push @flag_list, $f->id;
>+    }
>+
>+    return \@flag_list;
>+}


>Index: js/enterbug.js

Nit-pick: Please rename to js/enter_bug.js to match the cgi script name. Similar to the
current js/show_bug.js.

>Index: template/en/default/bug/create/create.html.tmpl

> var components = new Array([% product.components.size %]);

I don't see where this variable is used anywhere so we can remove it if that is true.

>+        else {
>+            var component_name = form.component.value;
>+            get_component_flags(product_name, component_name, index);

Nit-picks: 

1. vars component_name and product_name are not really needed. Just pass in the values directly.

          else {
              get_component_flags('[% product.name FILTER js %]', form.component.value, index);

Also you need to add the 'FILTER js' part to product.name as t/008filter.t complains if it is missing.

But other than those, the code works as expected.

Dave
Comment 13 Noura El hawary 2009-01-26 21:48:20 EST
Thanks for the review Dave, committed to cvs with your suggested fixes.

Noura
Comment 14 Noura El hawary 2009-01-26 21:57:17 EST
*** Bug 254010 has been marked as a duplicate of this bug. ***

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