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!
Take care.
|