[Q]python thread speedup?

Seung-won Hwang shwang5 at students.uiuc.edu
Fri Aug 17 18:44:02 EDT 2001


Hi,

Recently, I modified serial source routine to multiple-threaded version. The
list is divided into the same size of sub-lists and each sub-list is
assigned to each thread. Then, each thread returns the top object from the
sub-list it has and the top results from threads are merged.

To my surprise, multi-threaded version gave me as much as x4 speedup.
Considering that each thread just looks up array and does some computation,
I don't see significant thread blocking and thus expected that the
context-switch cost would dominate the performance gain..
I'd appreciate any comments that possibly explain this speedup.

Thanks,
Seung-won






More information about the Python-list mailing list