Bugzilla->request_cache() can be faster

RESOLVED FIXED in Bugzilla 6.0

Status

()

Bugzilla
Bugzilla-General
RESOLVED FIXED
2 years ago
a year ago

People

(Reporter: dylan, Assigned: dylan)

Tracking

(Blocks: 1 bug, {perf})

unspecified
Bugzilla 6.0
Dependency tree / graph

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

2 years ago
Using $r->pnotes for the request cache requires two method calls and multiple lookups to a package variable.

Experiments while poking at Bug 1251047 show request_cache over 7678 calls going from 326ms to 12.9ms
(Assignee)

Updated

2 years ago
See Also: → bug 1251047
(Assignee)

Comment 1

2 years ago
Created attachment 8723525 [details] [diff] [review]
1251208_1.patch

See Comment #0 for more reasonings.
Attachment #8723525 - Flags: review?(dkl)
Comment on attachment 8723525 [details] [diff] [review]
1251208_1.patch

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

r=dkl
Attachment #8723525 - Flags: review?(dkl) → review+
(Assignee)

Comment 3

2 years ago
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   9343e3a..438d57d  master -> master
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED

Updated

2 years ago
Target Milestone: --- → Bugzilla 6.0

Updated

2 years ago
Blocks: 1255835

Comment 4

2 years ago
Patch backed out. If you have an extension enabled, checksetup.pl never ends, and localconfig is deleted and replaced by the default one, see bug 1255835.

To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   777c785..53d6ba4  master -> master
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 5

2 years ago
Created attachment 8729632 [details] [diff] [review]
1251208_2.patch

So under a large number of circumstances, for a long time, Bugzilla::Install::Util::_cache and Bugzilla->request_cache have been the same thing. This patch preserves that relationship.

Hopefully better than the previous patch, this patch fixes the following problems:

1) pnotes() is slow
2) clear_request_cache assigns a new hash to request_cache, so the previous one (under non-mod-perl) stayed around forever. Here (as in the original patch) we clear the hash properly. 
3) non-lexical variables are not needed in module, and my() variables are (slightly) faster.

What is still ugly -- but required to prevent bug 1255835 -- is that the Install::Util cache and the request cache stay the same.
Attachment #8723525 - Attachment is obsolete: true
Attachment #8729632 - Flags: review?(LpSolit)
(Assignee)

Updated

2 years ago
Attachment #8729632 - Flags: review?(LpSolit) → review?(dkl)
Comment on attachment 8729632 [details] [diff] [review]
1251208_2.patch

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

r=dkl
Attachment #8729632 - Flags: review?(dkl) → review+
(Assignee)

Comment 7

2 years ago
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   0cac98d..da0347e  master -> master
Status: REOPENED → RESOLVED
Last Resolved: 2 years ago2 years ago
Resolution: --- → FIXED
(Assignee)

Updated

2 years ago
Blocks: 1262949
(Assignee)

Updated

2 years ago
Keywords: perf
(Assignee)

Updated

2 years ago
Blocks: 1302755
(Assignee)

Updated

a year ago
Blocks: 1319503
You need to log in before you can comment on or make changes to this bug.