Multiprocessing takes higher execution time
nick at craig-wood.com
Thu Jan 8 10:31:16 CET 2009
Sibtey Mehdi <sibteym at infotechsw.com> wrote:
> I use multiprocessing to compare more then one set of files.
> For comparison each set of files (i.e. Old file1 Vs New file1)
> I create a process,
> Process(target=compare, args=(oldFile, newFile)).start()
> It takes 61 seconds execution time.
> When I do the same comparison without implementing
> multiprocessing, it takes 52 seconds execution time.
> The oldProjects and newProjects will contains zip files
> i.e(oldxyz1.zip,oldxyz2.zip, newxyz2.zip,newxyz2.zip)
> it will unzip both the zip files and compare all the files between old
> and new (mdb files or txt files) and gives the result.
> I do this comparision for n number set of zip files and i assigne each
> set of zip files comparision to a process.
I had a brief look at the code and your use of multiprocessing looks
How many projects are you processing at once? And how many MB of zip
files is it? As reading zip files does lots of disk IO I would guess
it is disk limited rather than anything else, which explains why doing
many at once is actually slower (the disk has to do more seeks).
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick
More information about the Python-list