diff options
author | Dan McGee <dan@archlinux.org> | 2013-11-27 23:49:58 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2013-11-27 23:53:37 +0100 |
commit | 9adc2e53124daa6d13090166830396ffff9013d3 (patch) | |
tree | 37a7eea45098117216e4e708fa05f011e83b3821 /templates/mirrors/status_table.html | |
parent | 954b61ee3a0760990f8e17d7d692f3cabd949f9f (diff) | |
download | archweb-9adc2e53124daa6d13090166830396ffff9013d3.tar.gz archweb-9adc2e53124daa6d13090166830396ffff9013d3.tar.xz |
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 <dan@archlinux.org>
Diffstat (limited to 'templates/mirrors/status_table.html')
-rw-r--r-- | templates/mirrors/status_table.html | 6 |
1 files changed, 3 insertions, 3 deletions
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 @@ <td class="country">{% country_flag m_url.country %}{{ m_url.country.name }}</td> <td>{{ m_url.completion_pct|percentage:1 }}</td> <td>{{ m_url.delay|duration|default:'unknown' }}</td> - <td>{{ m_url.duration_avg|floatformat:2 }}</td> - <td>{{ m_url.duration_stddev|floatformat:2 }}</td> - <td>{{ m_url.score|floatformat:1|default:'∞' }}</td> + <td>{{ m_url.duration_avg|floatvalue:2 }}</td> + <td>{{ m_url.duration_stddev|floatvalue:2 }}</td> + <td>{{ m_url.score|floatvalue:1|default:'∞' }}</td> </tr>{% endfor %} </tbody> </table> |