Bug 1247796 - get_enterable_products() is slow for logged out users
get_enterable_products() is slow for logged out users
Status: CLOSED NOTABUG
Product: Bugzilla
Classification: Community
Component: Bugzilla General (Show other bugs)
4.4
Unspecified Unspecified
high Severity high (vote)
: ---
: ---
Assigned To: Jeff Fearn
tools-bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-28 18:46 EDT by Matt Tyson
Modified: 2015-08-04 19:33 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-04 19:33:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Mozilla Foundation 1188451 None None None Never

  None (edit)
Description Matt Tyson 2015-07-28 18:46:59 EDT
When fixing bug 1241767 upstream, it was found that get_enterable_products() is extremely slow for logged out users.  We should find out why this is the case and fix it.
Comment 1 Jason McDonald 2015-07-29 20:21:28 EDT
Which pages will this impact?
Comment 2 Matt Tyson 2015-07-29 20:30:26 EDT
(In reply to Jason McDonald from comment #1)
> Which pages will this impact?

show_bug.cgi and enter_bug.cgi
Comment 3 Jeff Fearn 2015-08-04 19:24:25 EDT
I've been testing this and I don't think it's a bug. The extra cost appears to be connecting to the DB. The way this test is constructed a logged in user will already have a connection as they have accessed the profiles table, whereas a logged out user hasn't done that so needs to start up a connection.

I've timing around Bugzilla->dbh in sub get_enterable_products and running the tests as per https://bugzilla.mozilla.org/show_bug.cgi?id=1183492#c9

$ perl -Mlib=lib -MTime::HiRes -MBugzilla -MBugzilla::User -wE 'my $user = Bugzilla::User->new(1); $user->groups_as_string; my $t0 = Time::HiRes::time(); my $groups = $user->get_enterable_products; my $t1 = Time::HiRes::time(); say $t1 - $t0'
2.86102294921875e-06
0.0195839405059814

$ perl -Mlib=lib -MTime::HiRes -MBugzilla -MBugzilla::User -wE 'my $user = Bugzilla::User->new(0); $user->groups_as_string; my $t0 = Time::HiRes::time(); my $groups = $user->get_enterable_products; my $t1 = Time::HiRes::time(); say $t1 - $t0'
0.0166680812835693
0.0258760452270508
Comment 4 Jeff Fearn 2015-08-04 19:33:02 EDT
Bug was closed upstream after feedback above was posted there.

Note You need to log in before you can comment on or make changes to this bug.