Hey Cristiano

Yeah it's a shame it didn't work out.

In our case, we would love to try Jinja2, but we can't, because the slow 
pages are in the Django Admin rather than our own code :(

For our main site we do use javascript templates - clientside as you say, 
except we call out to a node.js server to render the first page view 
"isomorphically" so Google likes us.

Pyjion does look intereseting, thanks for the link.

On Saturday, February 6, 2016 at 12:28:16 AM UTC, Cristiano Coelho wrote:
>
> Hi Adam,
>
> I'm sorry it didnt'work out after all, let me tell you that Python itself 
> is quite slow and the template engine has some good overhead as well making 
> this slowlyness even worse, greatly noticed on big or nested loops. Also, 
> 10% increase seems quite low to be important.
>
> I think that if you really want a performance boost you have a few options 
> (all quite bad though):
>
> - Use PyPy rather than python, this one is quite complicated if you have 
> cloud deplyoments or lots of 3rd party libraries.
> - Use Jinja2 template engine which is said to be faster
> - Re write the template engine or parts in actual C code as C extension 
> (this is very complicated)
> - Stop using templates completely (only keep it for a start page) and move 
> to client side templating such as AngularJS (the web is moving towards this 
> with client side + REST Api, this is a highly performant and scalable 
> option compared to server side templating)
> - There's a new Microsoft project called Pyjion, which says they have 
> implemented a JIT API for CPython, adding JIT support to python while still 
> being 100% compatible with it, this is quite different from PyPy approach. 
> I believe this is quite alpha yet but looks promising: 
> https://github.com/Microsoft/Pyjion
>
> El viernes, 5 de febrero de 2016, 13:23:59 (UTC-3), Adam Johnson escribió:
>>
>> Hi guys,
>>
>> I work with Alex here at YPlan. We deployed a tidied updated version of 
>> Alex's code as django-speedboost, since it looked promising in local 
>> profiling. You can see the code here: 
>> https://github.com/YPlan/django-speedboost . It uses a Cythonized 
>> version of Django 1.8.8's template engine, and passes Django 1.8.8's test 
>> suite. This is also compatible with 1.8.9, since there were no template 
>> changes, but not 1.9.x (as far as we know!).
>>
>> However, we did take it out of production recently though. The speed 
>> boost we could measure locally with profiling, about 10% on whole page 
>> time, didn't seem to translate into a speed boost in production. We don't 
>> really know why, but since it's quite hackish and requires maintenance, 
>> we've stopped using it. Just wanted to let everyone know where we got.
>>
>> Thanks,
>>
>> Adam
>>
>> On Tuesday, December 15, 2015 at 8:51:58 AM UTC, Florian Apolloner wrote:
>>>
>>>
>>>
>>> On Monday, December 14, 2015 at 3:53:50 PM UTC+1, Alexandru Damian wrote:
>>>>
>>>> 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. 
>>>>
>>>
>>> Well, defaulttags.pyx and base.pyx seems to indicate to me that the 
>>> whole files are compiled? I understand that this is most likely due to 
>>> cdefing some base classes -- therefore you need a C-context. But that is 
>>> what I ment with replacing the whole files.
>>>
>>> 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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
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/34c47e83-5019-49a3-9eaa-4f61fb8bec72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to