On Friday, December 11, 2015 at 9:11:55 AM UTC, Florian Apolloner wrote:
>
> Hi Alexandru,
>
> On Thursday, December 10, 2015 at 12:52:46 PM UTC+1, Alexandru Damian 
> wrote:
>>
>> I cProfile-instrumented *def get_response() *in 
>> *django/core/handlers/base.py  
>> *without (vanilla django) and with cemplate, posted the results here:
>>
>> https://github.com/ddalex/django-cemplate/tree/master/profile_data
>>
>
> The results are odd, looks as if you are running in a "test"-like 
> environment. Please make sure you run them with DEBUG=False and without any 
> test instrumentation to mimic a production environment.
>

I've switched to using *runprofileserver* from django-extended; the 
uploaded files are in kcachegrind format - these are profiled with all 
instrumentation off, and DEBUG set to False.

>
> Both profiles are with all caches primed. Please compare time spent in 
>> django/template/base.py in vanilla (0.773 seconds) and cemplate (0.288) 
>> seconds.
>>
>
> Yeah, that is roughly a 100% speedup in template rendering (does one say 
> 100% if twice as fast?!)
>  
>
>> Can you please advise on how to continue this work ? 
>>> I feel that maintaining separate trees for each Django release is not 
>>> scalable on my part.
>>>
>>  
>>> It’s difficult to say without knowing what you’re proposing. Is there 
>>> some change you’d like to see merged into Django? Some API hook that you’d 
>>> like to add to make your life easier?
>>>
>>
> I am not really convinced that replacing the whole file is a good idea. In 
> my experience one gets better results when using Cython by strategically 
> replacing single functions and rewriting those in C directly. 
>

This is the actual approach I am taking, but at class level. I selectively 
choose the base classes and convert those to Cython language; the modules 
are packaged in as a whole to make packaging easier. 

I am not sure how one would go about replacing just certain classes at 
runtime in Django, if that's your suggestion. Any suggestions ?

 

> A factor of two is all nice an well, but if this is still just 10% in the 
> overall response there might be other (better) optimizations out there.
>

I'm still trying to find low hanging fruits out here. I have profiled the 
no-data pages at 300ms which is still too high for my targets (render pages 
under 200ms). As expected, most of the time is spent in django.template.*, 
but it is difficult to pinpoint what exactly is going wrong.


> Cheers,
> Florian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/7fc6db92-8785-4bf7-bb37-f384745a2488%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to