[Image-SIG] Multi-threading and PIL

Stani spe.stani.be at gmail.com
Wed Aug 6 19:49:31 CEST 2008


Op woensdag 06-08-2008 om 09:45 uur [tijdzone -0600], schreef Kristofor
Amundson:

> My problem is that I see little to no improvement in my performance 
> with the threading, even when I process the images on a machine with 8 
> CPU's. In fact, it only seems to utilize one CPU. Is this due to the 
> GIL? 
Probably so.

> I am wondering if there is a way for me to properly thread this to 
> improve my performance.
I use mostly subprocess pools to increase multi-core performance, but of
course this might be not evident to implement depending on the specifics
of your software. That is the only way to take advantage of multi-core
CPU (or of course stackless python).

To speed up your existing code, you might also give psyco a try (which
is again in active development), profile your code and rewrite some
parts in cython or wait for PyPy to mature.

Stani



More information about the Image-SIG mailing list