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!
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!
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:
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/
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...