Closed Bug 365092 Opened 18 years ago Closed 18 years ago

Inactive flag types should be excluded from the JS array in the bug creation form

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

2.23.3
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: bernd_mozilla, Assigned: LpSolit)

References

()

Details

(Keywords: perf, regression)

Attachments

(1 file, 3 obsolete files)

and takes very long to load
for reference: https://bugzilla.mozilla.org/editflagtypes.cgi?action=edit&id=39 blocking1.3a Use this flag to nominate bugs for fixing in the 1.3alpha milestone. If the bug is deemed critical for the release by drivers@mozilla.org it will receive a "+". If the bug is deemed to not be critical for this release drivers will add a "-" to the flag. 1 Copy | Delete So, it's including disabled flags -- and we have lots of them.
The problem is about the flag_list array in JS. It takes 90+% of the total page size.
Keywords: perf
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 3.0
Version: unspecified → 2.23.3
Depends on: 365094
The bulk of the Enter Bug page is a per-component lists of which flags apply to the component. Easy fixes: (1) figure out why the flag list for each component is 20 times as long as it should be and fix that. (It is including disabled/obsolete flags?) (2) Convert the flag lists to array literals like "foo = [39, 43, ...]" instead of "foo[0] = 39", "foo[1] = 43", ... If that's not enough: (3) Add a list of flags that applies to all of the components, to get rid of redundancy. And if it's *still* too long (which I think is unlikely), it may need to be AJAXified.
Summary: core bugs page is too long (29K lines source) → Enter Bug page is too long (29K lines source for product=Core)
Flags: blocking3.0?
Inactive flag types cannot be set nor requested on bug creation, so let's exclude them.
Assignee: create-and-change → LpSolit
Status: NEW → ASSIGNED
Attachment #249750 - Flags: review?(justdave)
Comment on attachment 249750 [details] [diff] [review] patch, v1 (exclude inactive flag types) per test on bugzilla-test, lpsolit says "it's not quite right"
Attachment #249750 - Flags: review?(justdave) → review-
We don't specify the size of the JS array when creating it as it will depends on the number of inactive flag types.
Attachment #249750 - Attachment is obsolete: true
Attachment #249752 - Flags: review?(justdave)
For the record: With my patch applied, enter_bug.cgi's size decreases from 834 Kb to 169 Kb, and each component now has only 13 (active) flags instead of 154.
Attached patch Patch v3 (obsolete) — Splinter Review
Partially use array literals as well. (stuff like: flags[0] = [3,5,2,4,6];). Even better would be to make one big flags in one go, but I think this provides most of the saving while still being easy to follow. Note: the source used to be like: flags[0] = ["3","5","2","4","6"]; However, those quotes are not needed (AFAIK).
Attachment #249752 - Attachment is obsolete: true
Attachment #249754 - Flags: review?(LpSolit)
Attachment #249752 - Flags: review?(justdave)
Comment on attachment 249754 [details] [diff] [review] Patch v3 >+ [% flag_list.push("$f.id") %] Nit: you can write .push(f.id) directly. No need to add quotes. >+ flags[[% count %]] = [[% flag_list.join(",") %]]; t/008filter....NOK 165 # Failed test '(en/default) template/en/default/bug/create/create.html.tmpl has unfiltered directives: # 62: flag_list.join(",") # --ERROR' FILTER html or FILTER none will be fine here. I will attach an updated patch with both comments fixed. Nice work, bkor. r=LpSolit
Attachment #249754 - Flags: review?(LpSolit) → review+
Attached patch patch, v3.1Splinter Review
Fixing filterexceptions.pl as well. I realized meanwhile that JS code needs to use FILTER js.
Attachment #249754 - Attachment is obsolete: true
Attachment #249755 - Flags: review+
Flags: approval?
Flags: blocking3.0?
Flags: blocking3.0+
Flags: approval?
Flags: approval+
Checking in template/en/default/filterexceptions.pl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/filterexceptions.pl,v <-- filterexceptions.pl new revision: 1.93; previous revision: 1.92 done Checking in template/en/default/bug/create/create.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl,v <-- create.html.tmpl new revision: 1.74; previous revision: 1.73 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Summary: Enter Bug page is too long (29K lines source for product=Core) → Inactive flag types should be excluded from the JS array in the bug creation form
No longer depends on: 365094
(In reply to comment #7) > With my patch applied, enter_bug.cgi's size decreases from 834 Kb to 169 Kb, With the v3.1 patch, this page is now 113 Kb.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: