Closed Bug 552168 Opened 16 years ago Closed 16 years ago

Displaying bug comments loads users one at a time

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: mkanat, Assigned: mkanat)

Details

(Keywords: perf)

Attachments

(1 file)

Right now, when you call $bug->comments and then loop through them and call $comment->user on them (which basically every caller of $bug->comments does), we load the Bugzilla::User object individually for each comment. Currently on a bug with a large number of comments, this is the second-most time we spend in SQL. (0.15 seconds on my machine--not very much, but it's probably more on a loaded machine, and it's a pretty simple thing to fix, actually).
Attached patch v1Splinter Review
With this patch applied, the SQL for loading users disappears from the top 10 SQL calls entirely, even for the bug with the most comments on bmo, and it's a pretty simple patch.
Assignee: create-and-change → mkanat
Status: NEW → ASSIGNED
Attachment #432316 - Flags: review?(LpSolit)
Comment on attachment 432316 [details] [diff] [review] v1 I didn't test it, but it looks good. r=LpSolit
Attachment #432316 - Flags: review?(LpSolit) → review+
Do you want it for 3.6 too?
Flags: approval+
Flags: approval3.6+
Target Milestone: Bugzilla 3.8 → Bugzilla 3.6
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Bug.pm modified Bugzilla/Comment.pm Committed revision 7064 Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/3.6/ modified Bugzilla/Bug.pm modified Bugzilla/Comment.pm Committed revision 7033.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: