Closed Bug 174524 Opened 23 years ago Closed 23 years ago

Tidy up Bugzilla::{Util,Config}, and lazily-load unneeded modules

Categories

(Bugzilla :: Bugzilla-General, defect, P1)

2.17
x86
Linux
defect

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: bbaetz, Assigned: bbaetz)

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

I'll attach a patch which does two things: a) Move the POD to under an __END__ line. This allows the perl parser to avoid having to skip over all the POD, since it stops as soon as it gets to the __END__ line. The perf improvment of this was not measurable on my unloaded PIII-500. b) load Data::Dumper and File::Temp only when required. This speeds up loading Bugzilla::Config quite a bit, especially when combined with http://www.template-toolkit.org/pipermail/templates/2002-October/003790.html, which does the same thing to TT. (myk, you may want to apply that locally to bmo when you upgrade TT). With both these changes (incl the TT patch), |time perl -w -e 'use Bugzilla::Config'| goes from 0.54s to 0.20s, roughly. I can save about another 0.04s by removing the |use Safe| thing I added, and the rest is just generic noise, according to dprof.
Attached patch v1 (obsolete) — Splinter Review
Status: NEW → ASSIGNED
Keywords: patch, perf, review
Priority: -- → P1
Summary: Tidy up Bugzilla::{Util,Config}, and lazy-load uneeded modules → Tidy up Bugzilla::{Util,Config}, and lazily-load unneeded modules
Target Milestone: --- → Bugzilla 2.18
This is needed to get the speed increase on a real script (Except once every hour, of course)
Attachment #102914 - Attachment is obsolete: true
Comment on attachment 102916 [details] [diff] [review] s/use/require/ in globals.pl, too With the change to use.... { local $Data::Dumper::Sortkeys; local $Data::Dumper::Terse; local $Data::Dumper::Indent; } In Config.pm... r=joel
Attachment #102916 - Flags: review+
Checked in, with that change (needed because perl 5.6 doens't like the use vars trick I had to pull, probably correctly)
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: