Bug 1247796 - get_enterable_products() is slow for logged out users
Summary: get_enterable_products() is slow for logged out users
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Bugzilla
Classification: Community
Component: Bugzilla General
Version: 4.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 4.4
Assignee: Jeff Fearn 🐞
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-28 22:46 UTC by Matt Tyson 🤬
Modified: 2018-12-09 06:29 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-08-04 23:33:02 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Mozilla Foundation 1188451 0 None None None Never

Description Matt Tyson 🤬 2015-07-28 22:46:59 UTC
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-30 00:21:28 UTC
Which pages will this impact?

Comment 2 Matt Tyson 🤬 2015-07-30 00:30:26 UTC
(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 23:24:25 UTC
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 23:33:02 UTC
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.