Newbie queue question

Jure Erznožnik jure.erznoznik at
Fri Jun 19 03:29:11 EDT 2009

I've done some further testing on the subject:

I also added some calculations in the main loop to see what effect
they would have on speed. Of course, I also added the same
calculations to the single threaded functions.
They were simple summary functions, like average, sum, etc. Almost no
interaction with the buffers was added, just retrieval of a single
field's value.

Single threaded, the calculations added another 4.3 seconds to the
processing time (~18%)
MultiThreaded, they added 1.8 seconds. CPU usage remained below 100%
of one core at all times. Made me check the process affinity.

I know the main thread uses way less CPU than DBF reading thread (4
secs vs 22 secs).
So I think adding these calculations should have but a minimal impact
on threaded execution time.

Instead, the execution time increases!!!
I'm beginning to think that Python's memory management / functions
introduce quite a significant overhead for threading.

I think I'll just write this program in one of the compilers today to
verify just how stupid I've become.

More information about the Python-list mailing list