From 5fc1b86cfeeaf5e8e64dfbef3cd94f13a899d696 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Fri, 16 Nov 2012 18:10:32 +0100 Subject: Bug 797636: Improve performance for buglists r=dkl a=LpSolit --- template/en/default/bug/time.html.tmpl | 8 ++--- template/en/default/filterexceptions.pl | 3 +- template/en/default/list/table.html.tmpl | 51 ++++++++++++++++---------------- 3 files changed, 29 insertions(+), 33 deletions(-) (limited to 'template') diff --git a/template/en/default/bug/time.html.tmpl b/template/en/default/bug/time.html.tmpl index 370aad679..317c19cde 100644 --- a/template/en/default/bug/time.html.tmpl +++ b/template/en/default/bug/time.html.tmpl @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. #%] - + [% BLOCK formattimeunit %] [%# INTERFACE: # time_unit: the number converting, converts to 2 decimal places @@ -13,11 +13,7 @@ # 1 decimal place #%] [% time_unit = time_unit FILTER format('%.2f') %] - [% IF time_unit.match('0\Z') %] - [% time_unit FILTER format('%.1f') %] - [% ELSE %] - [% time_unit FILTER format('%.2f') %] - [% END %] + [% time_unit.replace('0\Z', '') %] [% END %] [% BLOCK calculatepercentage %] diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index 62084e727..44ae2b5da 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -261,8 +261,7 @@ 'bug/time.html.tmpl' => [ - 'time_unit FILTER format(\'%.1f\')', - 'time_unit FILTER format(\'%.2f\')', + "time_unit.replace('0\\Z', '')", '(act / (act + rem)) * 100 FILTER format("%d")', ], diff --git a/template/en/default/list/table.html.tmpl b/template/en/default/list/table.html.tmpl index 96f4ea342..e394eee4d 100644 --- a/template/en/default/list/table.html.tmpl +++ b/template/en/default/list/table.html.tmpl @@ -28,6 +28,7 @@ [% field_descs.reporter_realname = field_descs.reporter %] [% field_descs.qa_contact_realname = field_descs.qa_contact %] +[%# Setting maxlength => 0 means no limit. We set it for performance reasons. %] [% abbrev = { "bug_severity" => { maxlength => 3 , title => "Sev" } , @@ -41,19 +42,19 @@ "qa_contact" => { maxlength => 30 , ellipsis => "..." , title => "QAContact" } , "qa_contact_realname" => { maxlength => 20 , ellipsis => "..." , title => "QAContact" } , "resolution" => { maxlength => 4 } , - "short_desc" => { wrap => 1 } , + "short_desc" => { maxlength => 0, wrap => 1 } , "short_short_desc" => { maxlength => 60 , ellipsis => "..." , wrap => 1 } , - "status_whiteboard" => { title => "Whiteboard" , wrap => 1 } , - "keywords" => { wrap => 1 } , - "flagtypes.name" => { wrap => 1 } , + "status_whiteboard" => { maxlength => 0, title => "Whiteboard" , wrap => 1 } , + "keywords" => { maxlength => 0, wrap => 1 } , + "flagtypes.name" => { maxlength => 0, wrap => 1 } , "component" => { maxlength => 8 , title => "Comp" } , "product" => { maxlength => 8 } , "version" => { maxlength => 5 , title => "Vers" } , "op_sys" => { maxlength => 4 } , "bug_file_loc" => { maxlength => 30 } , - "target_milestone" => { title => "TargetM" } , - "longdescs.count" => { title => "# Comments" }, - "percentage_complete" => { format_value => "%d %%" } , + "target_milestone" => { maxlength => 0, title => "TargetM" } , + "longdescs.count" => { maxlength => 0, title => "# Comments" }, + "percentage_complete" => { maxlength => 0, format_value => "%d %%" } , } %] @@ -137,13 +138,13 @@ [% END %] [% BLOCK order_arrow %] - [% IF order.match("^$id DESC") %] + [% IF order.search("^$id DESC") %] - [% ELSIF order.match("^$id(,\\s*|\$)") %] + [% ELSIF order.search("^$id(,\\s*|\$)") %] - [% ELSIF order.match("\\b$id DESC") %] + [% ELSIF order.search("\\b$id DESC") %] - [% ELSIF order.match("\\b$id(,\\s*|\$)") %] + [% ELSIF order.search("\\b$id(,\\s*|\$)") %] [% END %] [% END %] @@ -178,41 +179,41 @@ [% FOREACH column = displaycolumns %] - - [% IF abbrev.$column.maxlength %] + [% IF col_abbrev.maxlength %] [% END %] - [% IF abbrev.$column.format_value %] - [%- bug.$column FILTER format(abbrev.$column.format_value) FILTER html -%] + [% IF col_abbrev.format_value %] + [%- bug.$column FILTER format(col_abbrev.format_value) FILTER html -%] [% ELSIF column == 'actual_time' || column == 'remaining_time' || column == 'estimated_time' %] [% PROCESS formattimeunit time_unit=bug.$column %] [%# Display the login name of the user if their real name is empty. %] - [% ELSIF column.match('_realname$') && bug.$column == '' %] + [% ELSIF column.search('_realname$') && bug.$column == '' %] [% SET login_column = column.remove('_realname$') %] - [% bug.${login_column}.truncate(abbrev.$column.maxlength, - abbrev.$column.ellipsis) FILTER html %] + [% bug.${login_column}.truncate(col_abbrev.maxlength, + col_abbrev.ellipsis) FILTER html %] [% ELSIF column == 'short_desc' || column == "short_short_desc" %] - [%- bug.$column.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%] + [%- bug.$column.truncate(col_abbrev.maxlength, col_abbrev.ellipsis) FILTER html -%] [% ELSE %] - [%- display_value(column, bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%] + [%- display_value(column, bug.$column).truncate(col_abbrev.maxlength, col_abbrev.ellipsis) FILTER html -%] [% END %] - [% IF abbrev.$column.maxlength %] + [% IF col_abbrev.maxlength %] [% END %] [% END %] +[% END %] - [% IF loop.last() && time_info.time_present == 1 %] - [% PROCESS time_summary_line %] - [% END %] - +[% IF time_info.time_present %] + [% PROCESS time_summary_line %] [% END %] -- cgit v1.2.3-24-g4f1b