-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Better zipping #6587
Better zipping #6587
Conversation
Looks cool. An alternative to save a few MB would be https://commons.apache.org/proper/commons-compress/examples.html. and switch back to xz compression. |
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 7z available on F-Droid?
@licaon-kter ^^. Can we assume that the build machine has 7z binary installed? Also, for future proof, it is ok to have this artifact as a dependency: https://mvnrepository.com/artifact/org.apache.commons/commons-compress ? |
If Debian Stretch (for now) has it... I'd go with xz though, as 7zip is soo old. But whatever you want. |
zip is even older! I would have no problems with xz. In fact I would prefer it. By the way. Using 7z for zip-file creation might be less invasive than switching to xz, my 5ct. |
I meant old as in stuck at version 16 and no newer source code. |
Because ZipInputStream is part of java/android libraries. That makes possible to catch errors uncompressing, which was not possible using 7z via ffi. It should be a matter of replacing the offending function with an updated one using apache common compress artifact. See https://github.com/koreader/android-luajit-launcher/blob/master/app/src/org/koreader/launcher/utils/AssetsUtils.kt#L101-L151 |
This gives about 1Meg smaller apk.
Compression time on a quad-core is about twice as
zip -r9
, when usingmx=7
its about the same time (of course then the compression is not as good, but saves 800k)Decompression memory usage does not seem to be bigger: Tested with grep
grep VmPeak /proc/$PID/status
andgrep VmHWM /proc/$PID/status
showed almost identical values.I have used this compression the last weeks on Tolino and phone without strange effects.
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)