Are there something like "Effective Python"?
Luis M. González
luismgz at gmail.com
Fri Jun 2 01:44:44 EDT 2006
Mike Meng wrote:
> Hi all,
> I just finished reading Learning Python 3rd ed, and am doing my
> first Python application, which retrieves and process text and XML
> documents from Web. Python helped me to write the application in a few
> hours, I'm very happy with its productivity. But the performance is not
> satisfactory. I decide to optimized it in Python before trying C/C++
> extensions. But I don't know Python much and have no clu to tune my
> program. Also, I don't know what Pythonist's preferred styles. Are
> there any books/documents which play the similar role for Python as
> 'Effective C++' does for C++?
>
> For example, one of my friends read my program and suggest me to
> move the re.compile() out of a for-loop, since the regular pattern is
> fixed, and re.compile() is slow. I want to find more such advice, where
> can I find them?
>
> Thank you.
>
> Mike
http://wiki.python.org/moin/PythonSpeed/PerformanceTips
Also, I suggest checking Psyco ( http://psyco.sourceforge.net/ ), which
can easily improve your program's speed with no change in your code.
Hope this helps...
Luis
More information about the Python-list
mailing list