Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dear John:
Your treehash library is fantastic, I really loved it!
Your code is clean and powerful, and It's convenient to use. because I can install from pip no matter where i am.
And I noticed that , this treehash lib use only one thread to compute hash and read file in the mean time, so I thought maybe I can help to speed it up a little bit.
So I added a multithread trick to speed up hashing
using the main thread to read file, and hand out hashing jobs to thread pool.
Pros: faster speed
I tested a 37GB file using 4 hashing threads on my computer, the consumed time reduced from 4'23 to 1'39. That's really a speedup. (271%)
Cons:compatibility
I imported concurrent.futures to use the thread pool, which is only for python3 , so this PR is not compatible with python2