Closed Bug 696256 Opened 13 years ago Closed 13 years ago

global/variables.none.tmpl should be PRE_PROCESS'ed

Categories

(Bugzilla :: User Interface, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: LpSolit, Assigned: LpSolit)

Details

(Keywords: perf)

Attachments

(1 file)

As all pages (modulo a page or two at most) require global/variables.none.tmpl (because global/header.html.tmpl requires it, for instance), we should list it in the PRE_PROCESS parameter in Bugzilla::Template->create(). This would let us remove all [% PROCESS global/variables.none.tmpl %] calls spread across all templates. This also means that templates would always have access to terms.foo and wouldn't have to worry about loading this template first.
+1
I'd be surprised if this has a measurable effect on performance, though.
Attached patch patch, v1Splinter Review
Assignee: ui → LpSolit
Status: NEW → ASSIGNED
Attachment #568647 - Flags: review?(dkl)
(In reply to Max Kanat-Alexander from comment #2)
> I'd be surprised if this has a measurable effect on performance, though.

The time is the same (I see no difference due to the noise), but there is a small decrease in the number of calls to Template::Stash::XS and Template::Context. When viewing a bug with many comments, NYTProf reports:

before: executing 612397 statements and 216212 subroutine calls

after:  executing 609442 statements and 215383 subroutine calls

This is minor, but still good to have. At this point, I don't expect major improvements in our codebase, but rather the sum of several minor improvements.
Comment on attachment 568647 [details] [diff] [review]
patch, v1

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

::: template/en/default/global/variables.none.tmpl
@@ +41,4 @@
>    }
>  %]
>  
> +[% USE Hook %]

Probably should add a comment here that this does "USE Hook" globally for all templates.
Attachment #568647 - Flags: review?(dkl) → review+
Flags: approval+
Target Milestone: --- → Bugzilla 5.0
(In reply to Frédéric Buclin from comment #4)
> This is minor, but still good to have. At this point, I don't expect major
> improvements in our codebase, but rather the sum of several minor
> improvements.

  Yeah, I do agree with that. We should still focus on the *biggest* time-consumers, but I just ran an NYTProf on index.cgi, and it does seem like you're doing that too, with the Load stuff. And the biggest time-consumers there are pretty small. So for at least with basic pages like index.cgi, we're going to be doing small improvements.

  For show_bug.cgi and buglist.cgi, I still suspect we have some big stuff to handle, though, not just these small fixes.
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/             
modified Bugzilla/Template.pm
modified extensions/Voting/template/en/default/pages/voting.html.tmpl                    
modified extensions/Voting/template/en/default/pages/voting/bug.html.tmpl                
modified extensions/Voting/template/en/default/pages/voting/user.html.tmpl
modified extensions/Voting/template/en/default/voting/delete-all.html.tmpl
modified extensions/Voting/template/en/default/voting/votes-removed.txt.tmpl
modified t/004template.t
modified template/en/default/index.html.tmpl                                             
modified template/en/default/welcome-admin.html.tmpl
modified template/en/default/account/cancel-token.txt.tmpl
modified template/en/default/account/create.html.tmpl                                    
modified template/en/default/account/created.html.tmpl
modified template/en/default/account/auth/login-small.html.tmpl
modified template/en/default/account/auth/login.html.tmpl
modified template/en/default/account/email/change-new.txt.tmpl
modified template/en/default/account/email/change-old.txt.tmpl                           
modified template/en/default/account/email/request-new.txt.tmpl
modified template/en/default/account/password/forgotten-password.txt.tmpl
modified template/en/default/account/prefs/email.html.tmpl
modified template/en/default/account/prefs/permissions.html.tmpl
modified template/en/default/admin/admin.html.tmpl                                       
modified template/en/default/admin/sudo.html.tmpl
modified template/en/default/admin/classifications/footer.html.tmpl
modified template/en/default/admin/components/edit.html.tmpl
modified template/en/default/admin/components/list.html.tmpl
modified template/en/default/admin/components/select-product.html.tmpl
modified template/en/default/admin/fieldvalues/edit.html.tmpl
modified template/en/default/admin/fieldvalues/list.html.tmpl
modified template/en/default/admin/fieldvalues/select-field.html.tmpl
modified template/en/default/admin/flag-type/confirm-delete.html.tmpl
modified template/en/default/admin/flag-type/edit.html.tmpl
modified template/en/default/admin/flag-type/list.html.tmpl
modified template/en/default/admin/keywords/edit.html.tmpl                               
modified template/en/default/admin/keywords/list.html.tmpl
modified template/en/default/admin/milestones/edit.html.tmpl
modified template/en/default/admin/milestones/list.html.tmpl
modified template/en/default/admin/milestones/select-product.html.tmpl
modified template/en/default/admin/params/editparams.html.tmpl
modified template/en/default/admin/products/list-classifications.html.tmpl
modified template/en/default/admin/products/list.html.tmpl
modified template/en/default/admin/products/groupcontrol/confirm-edit.html.tmpl
modified template/en/default/admin/products/groupcontrol/edit.html.tmpl
modified template/en/default/admin/sanitycheck/list.html.tmpl
modified template/en/default/admin/sanitycheck/messages.html.tmpl
modified template/en/default/admin/versions/edit.html.tmpl
modified template/en/default/admin/versions/list.html.tmpl
modified template/en/default/admin/versions/select-product.html.tmpl
modified template/en/default/attachment/choose.html.tmpl
modified template/en/default/attachment/confirm-delete.html.tmpl                         
modified template/en/default/attachment/created.html.tmpl
modified template/en/default/attachment/diff-footer.html.tmpl
modified template/en/default/attachment/diff-header.html.tmpl
modified template/en/default/attachment/edit.html.tmpl
modified template/en/default/attachment/midair.html.tmpl
modified template/en/default/attachment/show-multiple.html.tmpl
modified template/en/default/attachment/updated.html.tmpl
modified template/en/default/bug/choose.html.tmpl
modified template/en/default/bug/dependency-graph.html.tmpl
modified template/en/default/bug/edit.html.tmpl
modified template/en/default/bug/format_comment.txt.tmpl
modified template/en/default/bug/knob.html.tmpl
modified template/en/default/bug/navigate.html.tmpl
modified template/en/default/bug/show.html.tmpl
modified template/en/default/bug/activity/show.html.tmpl
modified template/en/default/bug/create/created.html.tmpl                                
modified template/en/default/bug/create/make-template.html.tmpl
modified template/en/default/bug/create/user-message.html.tmpl
modified template/en/default/bug/process/bugmail.html.tmpl
modified template/en/default/bug/process/confirm-duplicate.html.tmpl
modified template/en/default/bug/process/header.html.tmpl
modified template/en/default/bug/process/midair.html.tmpl
modified template/en/default/bug/process/results.html.tmpl
modified template/en/default/bug/process/verify-new-product.html.tmpl
modified template/en/default/email/flagmail.txt.tmpl
modified template/en/default/email/lockout.txt.tmpl
modified template/en/default/email/sanitycheck.txt.tmpl
modified template/en/default/email/sudo.txt.tmpl
modified template/en/default/extensions/config.pm.tmpl
modified template/en/default/extensions/extension.pm.tmpl
modified template/en/default/extensions/hook-readme.txt.tmpl
modified template/en/default/extensions/license.txt.tmpl
modified template/en/default/extensions/name-readme.txt.tmpl
modified template/en/default/extensions/util.pm.tmpl
modified template/en/default/extensions/web-readme.txt.tmpl
modified template/en/default/global/choose-product.html.tmpl
modified template/en/default/global/field-descs.none.tmpl
removed template/en/default/global/initialize.none.tmpl
modified template/en/default/global/message.html.tmpl
modified template/en/default/global/message.txt.tmpl
modified template/en/default/global/messages.html.tmpl
modified template/en/default/global/setting-descs.none.tmpl
modified template/en/default/global/site-navigation.html.tmpl
modified template/en/default/global/useful-links.html.tmpl
modified template/en/default/global/user-error.html.tmpl
modified template/en/default/global/variables.none.tmpl
modified template/en/default/list/change-columns.html.tmpl
modified template/en/default/list/list-simple.html.tmpl
modified template/en/default/list/list.ics.tmpl
modified template/en/default/list/quips.html.tmpl
modified template/en/default/list/server-push.html.tmpl
modified template/en/default/pages/linkify.html.tmpl
modified template/en/default/pages/release-notes.html.tmpl
modified template/en/default/pages/sudo.html.tmpl
modified template/en/default/reports/duplicates-simple.html.tmpl
modified template/en/default/reports/duplicates.html.tmpl
modified template/en/default/reports/keywords.html.tmpl
modified template/en/default/reports/menu.html.tmpl
modified template/en/default/reports/report-bar.png.tmpl
modified template/en/default/reports/report-line.png.tmpl
modified template/en/default/reports/report-simple.html.tmpl
modified template/en/default/reports/report-table.csv.tmpl
modified template/en/default/request/queue.html.tmpl
modified template/en/default/search/knob.html.tmpl
modified template/en/default/search/search-advanced.html.tmpl
modified template/en/default/search/search-create-series.html.tmpl
modified template/en/default/search/search-plugin.xml.tmpl
modified template/en/default/search/search-report-graph.html.tmpl
modified template/en/default/search/search-report-table.html.tmpl
modified template/en/default/search/search-specific.html.tmpl
modified template/en/default/whine/mail.html.tmpl
modified template/en/default/whine/multipart-mime.txt.tmpl
modified template/en/default/whine/schedule.html.tmpl
Committed revision 7990.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: