[Pythonmac-SIG] Speed up Python on the Mac?

Nicholas Riley njriley at uiuc.edu
Tue Dec 6 19:14:43 CET 2005


On Tue, Dec 06, 2005 at 12:07:26PM -0500, Louis Pecora wrote:
> I am seeking opinions on the best approaches to speed up Python on my 
> Mac (OS X 10.3.9).
> 
> I know about the profiling and find the bottlenecks approach, but then 
> the choices of what to do are not clear.  I have in the past written a 
> few C modules and turned them into importable Python modules, but that 
> was really time consuming and frustrating.

Perhaps you can describe some of the bottlenecks you're experiencing,
or post some code fragments?  The lsprof profiler has worked for me:

  <http://codespeak.net/svn/user/arigo/hack/misc/lsprof/>

> I see there are many other approaches (SWIG, Pyrex, Psyco -- some may 
> not be available on the Mac), so I thought I would start here to ask 
> what people in this email list use and recommend. 

Psyco for the most part does not work on non-Intel processors.  PyPy
static translation does work if you write in RPython, but debugging
translation failures is time-consuming and not particularly easy.

If you have any free x86 boxes, you might do what I do - write on the
Mac and run somewhere else faster, perhaps with Psyco.  That also has
the benefit of keeping your Mac free for interactive use.

-- 
Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>


More information about the Pythonmac-SIG mailing list