url template tag taking a long time

1 view
Skip to first unread message

Brian Neal

unread,
Apr 7, 2010, 12:08:11 AM4/7/10
to Django users
I am on trunk, somewhere around revision 127xx and just updated to
12936. A couple of my views render this one particular template, which
used to take less than a second to see a response. Now it is taking
almost a minute. The Django debug toolbar reports nothing out of the
ordinary in terms of SQL queries. Something like 12 queries in 6.42
ms. But user CPU time is nearly 1 minute.

I started removing junk from my template until it started responding
normally, and I isolated it down to a {% url %} tag. Well, I don't
think it was just one, maybe a few of them combined was adding up to a
minute.

<a href="{% url news.views.category category=story.category.id,page=1
%}">

Anyone else seeing this? Thoughts?

Maybe unrelated, but I also noticed that after I updated, I had to
change this:

{% url bio-members_full type="user",page="1" %}

to this:

{% url bio-members_full type='user',page=1 %}"

(switch to single quotes in the kwargs to pass a string literal) or I
got a template syntax error.

Thanks,
BN

Russell Keith-Magee

unread,
Apr 7, 2010, 12:53:19 AM4/7/10
to django...@googlegroups.com
On Wed, Apr 7, 2010 at 12:08 PM, Brian Neal <bgn...@gmail.com> wrote:
> I am on trunk, somewhere around revision 127xx and just updated to
> 12936. A couple of my views render this one particular template, which
> used to take less than a second to see a response. Now it is taking
> almost a minute. The Django debug toolbar reports nothing out of the
> ordinary in terms of SQL queries. Something like 12 queries in 6.42
> ms. But user CPU time is nearly 1 minute.
>
> I started removing junk from my template until it started responding
> normally, and I isolated it down to a {% url %} tag. Well, I don't
> think it was just one, maybe a few of them combined was adding up to a
> minute.
>
> <a href="{% url news.views.category category=story.category.id,page=1
> %}">
>
> Anyone else seeing this? Thoughts?

Are you running on SVN trunk? If so, it's possible that you're seeing
the effects of #13275 [1].

This is a major regression that was introduced recently to solve a
different problem (#12945, which was in turn a fix for #12072). This
problem is on the 1.2 critical list, so it needs to be fixed before
1.2 is released.

[1] http://code.djangoproject.com/ticket/13275

> Maybe unrelated, but I also noticed that after I updated, I had to
> change this:
>
> {% url bio-members_full type="user",page="1" %}
>
> to this:
>
> {% url bio-members_full type='user',page=1 %}"
>
> (switch to single quotes in the kwargs to pass a string literal) or I
> got a template syntax error.

This sounds like you may have found an additional regression case
caused by the same chain of tickets.

Yours,
Russ Magee %-)

Brian Neal

unread,
Apr 7, 2010, 7:26:56 PM4/7/10
to Django users
On Apr 6, 11:53 pm, Russell Keith-Magee <freakboy3...@gmail.com>
wrote:

> On Wed, Apr 7, 2010 at 12:08 PM, Brian Neal <bgn...@gmail.com> wrote:
> > I am on trunk, somewhere around revision 127xx and just updated to
> > 12936. A couple of my views render this one particular template, which
> > used to take less than a second to see a response. Now it is taking
> > almost a minute. [...]

>
> > I started removing junk from my template until it started responding
> > normally, and I isolated it down to a {% url %} tag. Well, I don't
> > think it was just one, maybe a few of them combined was adding up to a
> > minute.
>
> > <a href="{% url news.views.category category=story.category.id,page=1
> > %}">
>
> > Anyone else seeing this? Thoughts?
>
> Are you running on SVN trunk? If so, it's possible that you're seeing
> the effects of #13275 [1].

Yes, I'm on SVN trunk.


>
> This is a major regression that was introduced recently to solve a
> different problem (#12945, which was in turn a fix for #12072). This
> problem is on the 1.2 critical list, so it needs to be fixed before
> 1.2 is released.
>
> [1]http://code.djangoproject.com/ticket/13275

Thanks for the confirmation. If there is anything I can help with let
me know. My laptop's CPU fan really kicks on when I hit that code. =:-
O

>
> > Maybe unrelated, but I also noticed that after I updated, I had to
> > change this:
>
> > {% url bio-members_full type="user",page="1" %}
>
> > to this:
>
> > {% url bio-members_full type='user',page=1 %}"
>
> > (switch to single quotes in the kwargs to pass a string literal) or I
> > got a template syntax error.
>
> This sounds like you may have found an additional regression case
> caused by the same chain of tickets.
>
> Yours,
> Russ Magee %-)

Regards,
BN

Reply all
Reply to author
Forward
0 new messages