Closed
Bug 169561
Opened 22 years ago
Closed 22 years ago
Speed up UserInGroup by using cached information
Categories
(Bugzilla :: Bugzilla-General, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.18
People
(Reporter: gerv, Assigned: gerv)
Details
Attachments
(1 file)
767 bytes,
patch
|
myk
:
review+
bugreport
:
review+
|
Details | Diff | Splinter Review |
UserInGroup currently does a DB lookup. We already have all the information we need to answer the UserInGroup question, because we found it out and stashed it away in $vars->{'user'}{'groups'} in the GetUserInfo() sub in CGI.pl, which is always executed. So, UserInGroup should use this information instead of accessing the DB. Hopefully this should speed things up a bit, as this is a frequently-called function. Gerv
Assignee | ||
Comment 1•22 years ago
|
||
Simple, yet effective :-) Gerv
Comment 2•22 years ago
|
||
Comment on attachment 99741 [details] [diff] [review] Patch v.1 Looks good, works. r=myk
Attachment #99741 -
Flags: review+
Comment 3•22 years ago
|
||
It's trivial, but since it affects security, this should get a second pair of eyes on it.
Assignee | ||
Comment 4•22 years ago
|
||
Joel's our groups man :-) Joel: does this look sane to you? I know you are probably rewriting this stuff, but anyway... Gerv
Comment 5•22 years ago
|
||
Comment on attachment 99741 [details] [diff] [review] Patch v.1 Eww. 'global variables are bad'. OTOH, we can't get rid of $vars until we have a User.pm anyway. Hmm.... Yeah, this probably is OK for now, but please don't go arround changing everywhere else. Joel should look at this, anyway.
Comment 6•22 years ago
|
||
Comment on attachment 99741 [details] [diff] [review] Patch v.1 This is fine. It will actually even still work after the groups stuff is in because GetUserInfo will populate the user hash as before.
Attachment #99741 -
Flags: review+
Assignee | ||
Comment 7•22 years ago
|
||
Fixed. Checking in globals.pl; /cvsroot/mozilla/webtools/bugzilla/globals.pl,v <-- globals.pl new revision: 1.201; previous revision: 1.200 done Gerv
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Updated•22 years ago
|
Target Milestone: --- → Bugzilla 2.18
Updated•12 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•