Best processor (i386) for Python performance?

Grant Edwards grante at visi.com
Thu Aug 26 12:08:56 EDT 2004


On 2004-08-26, Dave Brueck <dave at pythonapocrypha.com> wrote:

>>>In terms of multithreading, an I/O intensive app that is
>>>threaded can make use of dual procs.  Otherwise threaded apps
>>>can't for technical reasons (GIL and such but don't need to get
>>>into those details).
>> 
>> That's rather dissappointing.  If I write a multi-threaded app
>> in C it can utilize multiple processors, but the same app in
>> Python can't?
>
> Depends on what the multithreaded app _does_. If multiple
> processors are present then Python will use them, but how well
> they get used depends on how much and for what reasons the GIL
> gets released.
>
> I/O is the most common reason, so adding another processor to
> an I/O bound program can give you a good performance boost (in
> our lab I've seen easily 75% improvement over a single proc
> box for a program that was very I/O bound, but I haven't
> measured it to see if it's closer to 75% or to 100%
> improvement).

Now that I think about it, in my multi-threaded apps all the
threads almost always end up blocking on I/O.  A couple years
back I even added a GIL release to some of the termios() calls
so that I could get more parallelism when threads are waiting
for serial ports to drain or flush.

-- 
Grant Edwards                   grante             Yow!  I wonder if there's
                                  at               anything GOOD on tonight?
                               visi.com            



More information about the Python-list mailing list