Page 1 of 1

No multi-threaded hash calculation in v2.5.5.0

PostPosted: 05 Feb 2012 21:37
by andrashun
Hi,


I have just started to use Shareaza v2.5.5.0 SSE2 (x64), but it seems like that the hashing is only using one core of my quad-core x64 processor.

The process itself is very slow (even after I clicked on the "hash faster" button). My HD is not working hard, my CPU is 25% (so one core is working, the other three are idle).

I have many files to hash, but it will take ages to complete. The GUI responds slowly as well, the overall user experience isn't that good.

I think that I am not alone with this problem, so I wonder if you're planning to implement the parallel hashing in the near future?

I've optimized CPU, I/O and DB intense multi-threaded .NET code before. My C++ knowledge is dusty but I'd be happy to help if you need it.

Is there a Wiki page where I can get some info about joining the project as a developer?


Thanks,
Andras

Re: No multi-threaded hash calculation in v2.5.5.0

PostPosted: 06 Feb 2012 01:53
by ailurophobe
This has been discussed before...

Basically hashing is throttled on file I/O, on a mechanical hard drive hashing faster makes other applications work slower due to the seek times. This is obviously a much smaller issue if you have multiple hard drives to split the traffic over or an SSD, but Shareaza doesn't have the code to recognize those so it plays it safe unless the user changes the settings manually. And even then the settings are global instead of per drive, so making it fast for your SSD would choke the external USB hard drive...

If you want to you can add code to recognize the volume type and scale the throttling accordingly. Should be easier than parallelizing the code.

As for parallelizing the hashing... Probably not worth it. Some of the algorithms are explicitly serial and ALL of them were designed to be fast on cheap hardware of several years ago, so any reasonably current hardware can do them easy without parallelization. And parallelization would add significant overhead and hurt cache locality so it is not obvious how much it would actually help performance. Certainly it would not help efficiency... You would almost certainly need more watts per megabyte...

EDIT: Vista and later have I/O priority and handle hashing file traffic much better. That should also be factored in. (As long as the hashing thread has lower priority... I don't remember...)

Re: No multi-threaded hash calculation in v2.5.5.0

PostPosted: 10 Feb 2012 14:42
by raspopov
ailurophobe right, Shareaza even on old P4 can easily hit 200 MB/s but speed of modern HDD is about 40 MB/s...