Closed Bug 967607 Opened 10 years ago Closed 10 years ago

User.get shouldn't load data that requires extra database queries unless required

Categories

(Bugzilla :: WebService, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: glob, Assigned: glob)

Details

(Keywords: perf)

Attachments

(1 file)

Bug.user currently loads all data about a user, even if not requested, which is then filtered prior to being returned.

this has performance implications, especially for the user autocompletion.

on bmo, performing a user search for 'mco' results in 2829 database queries, taking approx 2 seconds on my development environment.  after fixing the code so it calls filter_wants, this drops to 17 queries taking approx 750ms.
What is Bug.user??? I cannot find it upstream.
oops, of course i mean User.get
OS: Mac OS X → All
Hardware: x86 → All
Summary: Bug.user shouldn't load data that requires extra database queries unless required → User.get shouldn't load data that requires extra database queries unless required
Attached patch 967607_1.patchSplinter Review
Attachment #8370150 - Flags: review?(dkl)
Comment on attachment 8370150 [details] [diff] [review]
967607_1.patch

Review of attachment 8370150 [details] [diff] [review]:
-----------------------------------------------------------------

Nit-pick about the line lengths being > 80 columns but otherwise works properly. r=dkl
Attachment #8370150 - Flags: review?(dkl) → review+
Flags: approval?
Flags: approval? → approval+
Severity: normal → enhancement
Target Milestone: --- → Bugzilla 5.0
Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/WebService/User.pm
Committed revision 8908.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: