Django is slower after changeset [6333]

0 views
Skip to first unread message

msaelices

unread,
Sep 16, 2007, 2:21:46 PM9/16/07
to Django developers
I created a ticket for it. Ticket is:
http://code.djangoproject.com/ticket/5513

After more than one hour of profiling, I found the problem. It creates
a session for every request.

I've attached patch on ticket:
http://code.djangoproject.com/attachment/ticket/5513/sessions_speedup_6364.diff

Again Django becomes fastest!

msaelices

unread,
Sep 16, 2007, 2:58:13 PM9/16/07
to Django developers
This is the last patch update:

http://code.djangoproject.com/attachment/ticket/5513/sessions_speedup_6364.2.diff

It improve performance a little, but It's difficult to test because
differences are minimal.

On 16 sep, 20:21, msaelices <msaeli...@gmail.com> wrote:
> I created a ticket for it. Ticket is:http://code.djangoproject.com/ticket/5513
>
> After more than one hour of profiling, I found the problem. It creates
> a session for every request.
>

> I've attached patch on ticket:http://code.djangoproject.com/attachment/ticket/5513/sessions_speedup...
>
> Again Django becomes fastest!

msaelices

unread,
Sep 16, 2007, 2:59:00 PM9/16/07
to Django developers

On 16 sep, 20:58, msaelices <msaeli...@gmail.com> wrote:
> This is the last patch update:
>

> http://code.djangoproject.com/attachment/ticket/5513/sessions_speedup...

Sorry, the correct link is this:

Malcolm Tredinnick

unread,
Sep 16, 2007, 7:24:39 PM9/16/07
to django-d...@googlegroups.com

Accessing setttings at import time is a bad idea -- and that's what
you're doing in that patch: you have to read settings.SESSION_ENGINE
before we can finish importing that file. It means that in cases where
you are doing manual configuration (via settings.configure()), you have
to do that prior to importing certain modules and that leads to messy
code. It also can result in settings being set in stone (once read, you
should never write to settings) too early in some cases, before the
environment is correctly set up.

If you want to factor out the dynamic import in that code, the global
should be a flag that indicates whether import is needed. You could even
make engine be None initally and, inside the function, only do the
import if engine is None.

Malcolm

--
If Barbie is so popular, why do you have to buy her friends?
http://www.pointy-stick.com/blog/

msaelices

unread,
Sep 16, 2007, 7:44:34 PM9/16/07
to Django developers
OK, after all, the main change it's already commited, and is the
important one.

On 17 sep, 01:24, Malcolm Tredinnick <malc...@pointy-stick.com> wrote:
> On Sun, 2007-09-16 at 11:21 -0700, msaelices wrote:
> > I created a ticket for it. Ticket is:
> >http://code.djangoproject.com/ticket/5513
>
> > After more than one hour of profiling, I found the problem. It creates
> > a session for every request.
>
> > I've attached patch on ticket:

> >http://code.djangoproject.com/attachment/ticket/5513/sessions_speedup...

Reply all
Reply to author
Forward
0 new messages