Bug 1143864: Replace |FILTER bug_link| in loops by direct calls to bug/link.html.tmpl to improve performance

r=dkl a=sgreen


git-svn-id: svn://10.0.0.236/trunk@265903 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzrmirror%bugzilla.org 2015-04-05 19:45:52 +00:00
parent e9f44978cd
commit c2b747240b
6 changed files with 20 additions and 18 deletions

View File

@ -1 +1 @@
9357 9358

View File

@ -1 +1 @@
d1c18ff2567cdaf9969fe719e30e3823e0fae738 cb8ec961ded401de227b023a7ff813330d0f3a08

View File

@ -565,7 +565,7 @@
<td class="field_value" colspan="2"> <td class="field_value" colspan="2">
<span id="duplicates"> <span id="duplicates">
[% FOREACH dupe = bug.duplicates %] [% FOREACH dupe = bug.duplicates %]
[% dupe.id FILTER bug_link(dupe, use_alias => 1) FILTER none %][% " " %] [% INCLUDE bug/link.html.tmpl bug = dupe, link_text = dupe.id, use_alias = 1 %][% " " %]
[% END %] [% END %]
</span> </span>
(<a href="buglist.cgi?bug_id=[% bug.duplicate_ids.join(",") FILTER html %]"> (<a href="buglist.cgi?bug_id=[% bug.duplicate_ids.join(",") FILTER html %]">
@ -1014,10 +1014,9 @@
value="[% bug.${field.name}.join(', ') FILTER html %]"> value="[% bug.${field.name}.join(', ') FILTER html %]">
[% END %] [% END %]
</span> </span>
[% FOREACH dep_bug = deps %] [% FOREACH dep_bug = deps %]
[% dep_bug.id FILTER bug_link(dep_bug, use_alias => 1) [% INCLUDE bug/link.html.tmpl bug = dep_bug, link_text = dep_bug.id, use_alias = 1 %][% " " %]
FILTER none %][% " " %]
[% END %] [% END %]
[% IF bug.check_can_change_field(field.name, 0, 1) %] [% IF bug.check_can_change_field(field.name, 0, 1) %]
<span id="[% field.name FILTER html %]_edit_container" <span id="[% field.name FILTER html %]_edit_container"

View File

@ -8,6 +8,8 @@
[%# INTERFACE: [%# INTERFACE:
# bug: a Bugzilla::Bug object # bug: a Bugzilla::Bug object
# user: the Bugzilla::User object to which this template is addressed.
# If not set, the currently logged in user object is used.
# link_text: the text that we're highlighting. # link_text: the text that we're highlighting.
# use_alias: boolean; If true, we display the bug's alias as the link # use_alias: boolean; If true, we display the bug's alias as the link
# text instead of link_text. # text instead of link_text.

View File

@ -22,9 +22,10 @@
<div> <div>
[% IF comment.count %] [% IF comment.count %]
[% comment_anchor = "#c$comment.count" %] [% comment_anchor = "#c$comment.count" %]
<b>[% "Comment # ${comment.count}" FILTER bug_link(bug, <b>[% INCLUDE bug/link.html.tmpl bug = bug, link_text = "Comment # ${comment.count}",
{comment_num => comment.count, full_url => 1, user => to_user}) FILTER none %] comment_num = comment.count, full_url = 1, user = to_user %]
on [% "$terms.bug $bug.id" FILTER bug_link(bug, { full_url => 1, user => to_user }) FILTER none %] on [% INCLUDE bug/link.html.tmpl bug = bug, link_text = "$terms.bug $bug.id",
full_url = 1, user = to_user %]
from [% INCLUDE global/user.html.tmpl user = to_user, who = comment.author %]</b> from [% INCLUDE global/user.html.tmpl user = to_user, who = comment.author %]</b>
[% END %] [% END %]
[% comment_div = comment.is_markdown ? "div" : "pre" %] [% comment_div = comment.is_markdown ? "div" : "pre" %]
@ -86,14 +87,14 @@
[% SET in_table = 0 %] [% SET in_table = 0 %]
[% END %] [% END %]
[% IF change.blocker %] [% IF change.blocker %]
[% "${terms.Bug} ${bug.id}" FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %] [% INCLUDE bug/link.html.tmpl bug = bug, link_text = "$terms.Bug $bug.id", full_url = 1, user = to_user %]
depends on depends on
[%+ "${terms.bug} ${change.blocker.id}" [%+ INCLUDE bug/link.html.tmpl bug = change.blocker, link_text = "$terms.bug $change.blocker.id",
FILTER bug_link(change.blocker, {full_url => 1, user => to_user}) FILTER none %], full_url = 1, user = to_user %],
which changed state. which changed state.
[% ELSE %] [% ELSE %]
[% INCLUDE global/user.html.tmpl user = to_user, who = change.who %] changed [% INCLUDE global/user.html.tmpl user = to_user, who = change.who %] changed
[%+ "${terms.bug} ${bug.id}" FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %] [%+ INCLUDE bug/link.html.tmpl bug = bug, link_text = "$terms.bug $bug.id", full_url = 1, user = to_user %]
[% END %] [% END %]
<br> <br>
[% IF in_table == 0 %] [% IF in_table == 0 %]
@ -117,7 +118,7 @@
<th>[% field_label FILTER html %]</th> <th>[% field_label FILTER html %]</th>
<td> <td>
[% IF change.field_name == "bug_id" %] [% IF change.field_name == "bug_id" %]
[% new_value FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %] [% INCLUDE bug/link.html.tmpl bug = bug, link_text = new_value, full_url = 1, user = to_user %]
[% ELSE %] [% ELSE %]
[% new_value FILTER html %] [% new_value FILTER html %]
[% END %] [% END %]

View File

@ -47,7 +47,7 @@
</p> </p>
<p> <p>
[% "$terms.Bug $bug.bug_id" FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %]: [% INCLUDE bug/link.html.tmpl bug = bug, link_text = "$terms.Bug $bug.id", full_url = 1, user = to_user %]:
[%= bug.short_desc FILTER html %] [%= bug.short_desc FILTER html %]
</p> </p>