Improve get_names() in report.cgi

RESOLVED FIXED in Bugzilla 4.2

Status

()

Bugzilla
Reporting/Charting
--
enhancement
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: Frédéric Buclin, Assigned: Frédéric Buclin)

Tracking

Bugzilla 4.2
Bug Flags:
approval +

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Created attachment 496189 [details] [diff] [review]
patch, v1

This patch makes get_names() in report.cgi much faster. For instance, I created two products with 1000 components each, and then wanted a tabular report with components and severity as column and row:

without the patch: 135 ms
with the patch:     89 ms

Then, I selected two other fields, which don't have as many items:

without the patch: 124 ms
with the patch:      3 ms (!!!)

This huge win is due to the fact that the old code was getting legal values for *all* existing select fields, even if those are not the ones selected by the user. I also fixed the O(n^2) problem. Globally, this patch makes the whole report.cgi script only a few percents faster, but this is still good to take.

Granting myself review as I'm allowed to refactor and clean up the code myself in the report/charting component.
Flags: approval+
Attachment #496189 - Flags: review+
(Assignee)

Comment 1

7 years ago
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified report.cgi
Committed revision 7616.
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.