Speno's Pythonic Avocado 19.1.2004

2004-01-19

PIL vs. CoreGraphics

In my previous entry, Goodbye PIL. Hello CoreGraphics I talked about how I had trouble getting PIL packaged up into an application. Today, I went back and got a pre-built PIL from the "offcial unofficial" PackageManager repository and tried it again. It worked! No muss, no fuss. Thanks, Bob!

Now I had both a PIL version and a CoreGraphics version so of course I raced them to see who was faster. Since this is a python blog, here was my quick and dirty main program for getting timing information:

if __name__ == '__main__': import HTMLPhotoGallery import sys import time f = open('/tmp/pylog', 'a') sys.stdout = sys.stderr = f then = time.clock() HTMLPhotoGallery.main(sys.argv[1:]) print time.clock() - then

After several test runs using the same inputs, my best time for the CoreGraphics version was 4.14 seconds and for PIL it was 1.94 seconds. Timing from run to run was consistent. The PIL version was always at least twice as fast as the CoreGraphics version. Hello PIL! Goodbye CoreGraphics! Smiley

Take care.

This post references topics: python
posted at 21:59:12    #    comment []    trackback []
January 2004
MoTuWeThFrSaSu
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
262728293031 
Dec
2003
 Feb
2004

One python programmer's search for understanding and avocados. This isn't personal, only pythonic.

XML-Image Letterimage

© 2004-2005, John P. Speno