Django template filters floatformat and intcomma: speed issues

258 views
Skip to first unread message

Kee

unread,
Nov 3, 2012, 12:05:15 PM11/3/12
to django-d...@googlegroups.com
Hello,

I was generating a lagrge table with django and wondered why response is so slow (it has ~ 2000 x 10), so I rewrote
profiled ``floatformat`` and ``intcomma`` and wrote down their implementations using builtin functions only.

Take a look: https://gist.github.com/4007717

Floatformat became faster almost 65 times, and intcomma became almost 6 times faster.

Of course I understand that Django template engine is not the fast one and for speed I need to use other solutions.

Russell Keith-Magee

unread,
Nov 3, 2012, 7:15:48 PM11/3/12
to django-d...@googlegroups.com

On Sun, Nov 4, 2012 at 12:05 AM, Kee <kipa...@gmail.com> wrote:
Hello,

I was generating a lagrge table with django and wondered why response is so slow (it has ~ 2000 x 10), so I rewrote
profiled ``floatformat`` and ``intcomma`` and wrote down their implementations using builtin functions only.

Take a look: https://gist.github.com/4007717

Floatformat became faster almost 65 times, and intcomma became almost 6 times faster.

Hi Kee,

Thanks for that suggestion; if you open a ticket with your code, we can see about getting this integrated into Django's core.

Yours,
Russ Magee %-)
Reply all
Reply to author
Forward
0 new messages