-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New compressionMethod types: TARGZ_BEST_SPEED, TAR #162
New compressionMethod types: TARGZ_BEST_SPEED, TAR #162
Conversation
GzipCompressorInputStream::new, | ||
".tgz") | ||
), | ||
TARGZ_NO_COMPRESSION(new TarArbitraryFileCacheStrategy( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any actual benefit compared to "tar only"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think not... :)
This started out as one of my first options, before adding the TAR-only option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want me to remove the TARGZ_NO_COMPRESSION option? I guess there is no practical use for it, when one can use the TAR option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think TAR
is enough :)
@@ -454,6 +456,21 @@ public enum CompressionMethod { | |||
GzipCompressorInputStream::new, | |||
".tgz") | |||
), | |||
TARGZ_BEST_SPEED(new TarArbitraryFileCacheStrategy( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you some examples which shows the difference in speed and archive size if using these parameters compared to the default settings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have found a couple of articles:
https://medium.com/linuxstories/comparison-of-gzip-bzip2-and-xz-compression-tools-7348ed910c68
See the "Testing gzip" section.
and https://www.rootusers.com/gzip-vs-bzip2-vs-xz-performance-comparison/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking if it would make sense to set this for the TARGZ
directly, as I did not really thought about this when while implementing the cache compression ;)
Do you know what happens, if you try to uncompress an archive with different settings as the ones used while compressing? If it works fine, I would say we change the settings of TARGZ
. Or do you think it would be nice to keep both?
btw: Thanks for your contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gzip library is able to uncompress gz-files written with different compression levels without further input parameters. The (necessary) metadata about the compression level is written to the gz-file.
In the Java library commons-compress:1.21
(that this plugin use), the metadata about compression level is written by the class GzipCompressorOutputStream
at lines 100-106.
For text files, such as source code (the node_modules
directory in web-apps for instance), it makes sense to use the "default" compression level (which is 6), because it is a "sweet spot" between compression speed and size. My recommendation is not to change that.
For directories with lots of mixed file types, both lots of text and binary files, users might have "need for speed", and can use TARGZ_BEST_SPEED
:)
For directories with lots of binary files, the TAR
option might be best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok nice, then lets go like this. Thanks for clarifying ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you mind to add this additional info to the readme? I think it would be helpful for new users to decide with setting they should choose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a new section Choosing the compression method to the README file.
I also included descriptions of the existing options, and I had to guess a bit... so please proof read it and correct me if I'm wrong :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! I have nothing to complain ;)
Adds more compression methods (some methods are without compression):
TARGZ_NO_COMPRESSION uses Deflate compressionLevel=0This solves #161