Closed Bug 897029 Opened 7 years ago Closed 7 years ago
Preload bug permissions when calling Bug
.get to improve performance
Bugzilla::Bug->check() passes one bug ID to Bugzilla::User->visible_bugs() to know if the user is allowed to access the bug. This means one DB call per bug. If we call Bugzilla::User->visible_bugs() with the whole list of bug IDs before calling Bugzilla::Bug->check(), then the DB isn't queried again and again, because permissions are already cached. In my testing with 1300 bugs being requested at once, the win is 0.5 second.
Attachment #779752 - Flags: review?(sgreen)
and NYTProf reports: without my patch: # spent 715ms (71.4+643) within Bugzilla::User::visible_bugs which was called 1302 times, avg 549µs/call with my patch: # spent 120ms (62.7+57.5) within Bugzilla::User::visible_bugs which was called 1303 times, avg 92µs/call
Committing to: bzr+ssh://email@example.com/bugzilla/trunk/ modified Bugzilla/WebService/Bug.pm Committed revision 8674.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.