Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Parallel Decompression #14

Closed
0rinsb3lt opened this issue May 15, 2018 · 9 comments
Closed

Parallel Decompression #14

0rinsb3lt opened this issue May 15, 2018 · 9 comments

Comments

@0rinsb3lt
Copy link
Contributor

Noticed that on restoring a system that there was a significant amount of time checking the archive
and wondered if it could be quicker with parallel decompression. I know that pbzip2 has it.

tar supports a -I option to use other programs such as pbzip2

  • tar -I pbzip2

possibly just reuse the -M --multi-core option for defining decompression (Restore mode).

@tritonas00
Copy link
Owner

tritonas00 commented May 15, 2018

possibly just reuse the -M --multi-core option for defining decompression (Restore mode).

Yes, it's possible, the code is already there for compression https://github.com/tritonas00/system-tar-and-restore/blob/master/star.sh#L529

i will look into it when i have my laptop back

@0rinsb3lt
Copy link
Contributor Author

I did a quick patch to enable this feature for p/bzip2.

diff.txt

@tritonas00
Copy link
Owner

tritonas00 commented May 16, 2018

no need to add extra statements in read_archive

replace tf with "$BRreadopts" here https://github.com/tritonas00/system-tar-and-restore/blob/master/star.sh#L1859, and then re arrange BRreadopts here https://github.com/tritonas00/system-tar-and-restore/blob/master/star.sh#L760-L778

also i thing you need -d https://linux.die.net/man/1/pbzip2

@0rinsb3lt
Copy link
Contributor Author

I took your suggestion with the "$BRreadopts" and here is what I came up with
diff.txt

as for the -d from what I read is that when passing a program via -I the program itself simply has to support the -d option

https://linux.die.net/man/1/tar

@tritonas00
Copy link
Owner

yes like that but the statement must be before https://github.com/tritonas00/system-tar-and-restore/blob/master/star.sh#L764 not after

when i have my laptop i will extend it to all compressors and add threads also

@0rinsb3lt
Copy link
Contributor Author

0rinsb3lt commented May 17, 2018

The diff shows that After 763 in the first file (original file) it's adding the lines from the second file (one I modified). That would put them above line 764.

Other than that I think it paves the way for other compressors. ( I have another modification that adds pixz support)

@tritonas00
Copy link
Owner

tritonas00 commented May 17, 2018

The diff shows that After 763 in the first file (original file) it's adding the lines from the second file (one I modified). That would put them above line 764.

you are right, i didn't watch carefully

Other than that I think it paves the way for other compressors. ( I have another modification that adds pixz support)

exactly, but please check if non parallel way still works

fork, add your code and create a pull request

thank you for your contribution

@0rinsb3lt
Copy link
Contributor Author

0rinsb3lt commented May 17, 2018

can confirm that without -M option bzip2 is used. With -M option pbzip2 is used.
#16

@tritonas00
Copy link
Owner

tritonas00 commented May 26, 2018

#16 merged, pbzip2 decompression is now done and you can use -z as well to define max threads

any idea of parallel decompressors for xz and gzip also?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants