No multi-threaded hash calculation in v2.5.5.0

Post comments about Shareaza code and discuss with other developers.
Forum rules
Home | Wiki | Rules

No multi-threaded hash calculation in v2.5.5.0

Postby andrashun » 05 Feb 2012 21:37

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
andrashun
 
Posts: 1
Joined: 05 Feb 2012 21:18

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

Postby ailurophobe » 06 Feb 2012 01:53

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...)
ailurophobe
 
Posts: 709
Joined: 11 Nov 2009 05:25

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

Postby raspopov » 10 Feb 2012 14:42

ailurophobe right, Shareaza even on old P4 can easily hit 200 MB/s but speed of modern HDD is about 40 MB/s...
User avatar
raspopov
Project Admin
 
Posts: 945
Joined: 13 Jun 2009 12:30


Return to Development Discussion

Who is online

Users browsing this forum: No registered users and 1 guest