From 9adc2e53124daa6d13090166830396ffff9013d3 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 27 Nov 2013 17:49:58 -0500 Subject: Stop using Django-provided floatformat template tag It turns out this is a HUGE part of our slow mirror status template rendering, due to the internal workings. Everything is converted to a Python decimal object which is way slower than just staying in native floating point. Given we are always dealing with floats when we need to do our formatting, a home-rolled template tag can accomplish this much faster. Signed-off-by: Dan McGee --- templates/mirrors/status_table.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'templates/mirrors/status_table.html') diff --git a/templates/mirrors/status_table.html b/templates/mirrors/status_table.html index 6fc07a3..00b9c1d 100644 --- a/templates/mirrors/status_table.html +++ b/templates/mirrors/status_table.html @@ -20,9 +20,9 @@ {% country_flag m_url.country %}{{ m_url.country.name }} {{ m_url.completion_pct|percentage:1 }} {{ m_url.delay|duration|default:'unknown' }} - {{ m_url.duration_avg|floatformat:2 }} - {{ m_url.duration_stddev|floatformat:2 }} - {{ m_url.score|floatformat:1|default:'∞' }} + {{ m_url.duration_avg|floatvalue:2 }} + {{ m_url.duration_stddev|floatvalue:2 }} + {{ m_url.score|floatvalue:1|default:'∞' }} {% endfor %} -- cgit v1.2.3-24-g4f1b