[Chicago] help from Django and Pylons developers

Massimo Di Pierro mdipierro at cs.depaul.edu
Mon Apr 28 20:52:21 CEST 2008


The speedup is not because of the bytecode compilation. But in order  
to bytecode compile web2py parses the templates and resolves all the  
includes and extend thus turning the entire template hierarchy for  
each page into a single python file which is then bytecode compiled.  
My users see a lot of speedup. In particular those users who run on  
smartphones and other platforms like the Nokia N800. I do not know  
whether Make does the same (that is why I asked) but probably now if  
you say there is no speed-up.

I updated the document based on your original comments but I have a  
philosophical question: if a feature is not documented and there is  
no example, is it really there?

Massimo


On Apr 28, 2008, at 1:18 PM, Ian Bicking wrote:

> Massimo Di Pierro wrote:
>> Thank you Ian,
>>
>> I think I incorporated almost all of your suggestions too although  
>> I do
>> not think that using FileApp for streaming is quite as easy as the  
>> web2py.
>
> Perhaps not, but it is the way to do it, and it does support all those
> features, and it was factored the way it is so you could do that  
> sort of
> thing.
>
>> I have never a Pylons example for connecting to multiple databases.
>> Would you mind posting an example?
>
> I'm not that familiar with the way databases are setup and  
> configured in
> Pylons, so I'm not sure.
>
>> About bytecode compilation. Send me a working Pylons bytecode  
>> compiled
>> application (including bytecode compiled models, views and  
>> controllers)
>> and the step you took to make it and I will believe you.
>
> Well, I've never tried, and I don't want to bother to try because I
> think it's a silly thing to do.  There are generally applicable
> techniques for Python (like python -m compileall; find . -name '*.py'
> -exec rm {} \;).  It's possible Pylons looks for *.py files or  
> something
> in some contexts (e.g., listing controllers), and so doesn't work with
> the source removed, so I can't say for sure if this would work by  
> itself.
>
>> Yes all bytecode compiled code can be decompiled (this is true for  
>> Java
>> and ASP as well) but for some people it is important. In the case of
>> web2py there are two reasons for it: 1) speed, there is no more  
>> template
>> parsing with bytecode compiled apps, 2) you are not explicitly giving
>> away the source code (if you decompile you do not get exactly the  
>> same
>> original code).
>
> There's no speed advantage: all Python code is all bytecode  
> compiled on
> demand.  Python does this automatically without any intervention.   
> Mako
> and several other templating languages replicate this behavior.  Also
> several distutils commands invoke bytecode compilation.
>
>
> --
> Ian Bicking : ianb at colorstudy.com : http://blog.ianbicking.org
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago



More information about the Chicago mailing list