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.
Uses
rayon
to calldecompress_file
in parallel.The gain in performance occurs only if more than one file/archive are being decompressed at the same time, e.g.
ouch d videos.tar.gz photos.tar.bz2
. If ouch takes 3 secs to decompressvideos.tar.gz
and 4 secs to decompressphotos.tar.bz2
it's safe to assume it'd take the previous single-threaded code 7 secs to decompress both since the operations take place in sequence.Using rayon it's generally safe to assume the runtime is clamped by the time it takes to decompress the biggest file, e.g. it'd multithreaded ouch 4 secs to decompress both
videos.tar.gz
andphotos.tar.bz2
I guess it's not a very common usecase to decompress many archives at once but I don't think this feature costs much. The binary size, at least, did not seem to increase
As a next step we can try using gzp by @sstadick to use Writers that work in parallel