Presentation is loading. Please wait.

Presentation is loading. Please wait.

A quick introduction to psyco: The Python Compiler Geoff Davis Triangle ZPUG December 6.

Similar presentations


Presentation on theme: "A quick introduction to psyco: The Python Compiler Geoff Davis Triangle ZPUG December 6."— Presentation transcript:

1 A quick introduction to psyco: The Python Compiler Geoff Davis Triangle ZPUG December 6

2 What is psyco? Open source python compiler – http://psyco.sourceforge.net Very easy to use Only works on 32-bit x86 processors – (or 64 bit in 32-bit compatibility mode)

3 How to use psyco Quick overview: – import psyco – psyco.full() That’s it! psyco then takes over DEMO

4 Play nice with Macs If distributing code for mixed platforms, put code in a try block: try: – import psyco – psyco.full() except: – pass

5 Use psyco selectively psyco tries to compile everything Not always useful – Compilation overhead – Uses lots of memory – Disables pdb Can use psyco more selectively

6 Precision psyco Can tell psyco to compile individual functions – E.g. SpeedPack – Profiled everything in CMF, then compiled slowest methods with psyco Can have both compiled and uncompiled versions: – fastfunction = psyco.proxy(slowfunction) DEMO

7 Plug for 10 minute talks Easy to put together! Took me 1 hour Lots of stuff would be useful in this format – Editors / IDEs – Debugging tools – Plone/Zope products – Pure python products No need for a huge, involved presentation Please volunteer!


Download ppt "A quick introduction to psyco: The Python Compiler Geoff Davis Triangle ZPUG December 6."

Similar presentations


Ads by Google