Skip to content
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

Enormous apk size increase (9MB -> 150MB) #105

Open
ColorfulRhino opened this issue Jul 17, 2024 · 17 comments
Open

Enormous apk size increase (9MB -> 150MB) #105

ColorfulRhino opened this issue Jul 17, 2024 · 17 comments

Comments

@ColorfulRhino
Copy link

Something is wrong with the latest apk. This has also been talked about here #34 (comment).

Size comparison:
v2.0.2: 9.29 MB
v2.0.3: 151 MB

More than 15x increase (!). Something's wrong, maybe a debug build was accidentally published or some recent commit added some unneccessarily large library?

@TPS TPS mentioned this issue Jul 17, 2024
2 tasks
@CrazyMarvin
Copy link
Contributor

We recently added the ability to remove metadata from some documents and videos that need some bigger dependencies.
Do you see any way to make the builds smaller, @Rashxz?

@Rashxz
Copy link
Contributor

Rashxz commented Jul 17, 2024

Yes, the increase is comming from the ffmpeg library, Ill see how to reduce the binary size.

@ColorfulRhino
Copy link
Author

Thanks for clearing that up! I'm sure there is some way.
In my opinion (!) it's totally not worth it for one or two features to have a >1500% size increase.

@Rashxz
Copy link
Contributor

Rashxz commented Jul 18, 2024

I manage to build a new binary, new size per ABI is roughly 30 MB, universal APK is 40MB.

@ColorfulRhino
Copy link
Author

I manage to build a new binary, new size per ABI is roughly 30 MB, universal APK is 40MB.

That's an improvement 👍
Still quite an increase and too big for Izzy's repo, but well done regardless.

@TPS
Copy link

TPS commented Aug 4, 2024

Yes, the increase is comming from the ffmpeg library, Ill see how to reduce the binary size.

I manage to build a new binary, new size per ABI is roughly 30 MB, universal APK is 40MB.

That's an improvement 👍
Still quite an increase and too big for Izzy's repo, but well done regardless.

Is it possible to get the same coverage by using using a different library, e.g., exiftool? On my termux, that's ¼ the installation size of ffmpeg, but has a perl dependency, so might come out even?

@TPS TPS mentioned this issue Aug 5, 2024
@Rashxz
Copy link
Contributor

Rashxz commented Aug 6, 2024

Yes, the increase is comming from the ffmpeg library, Ill see how to reduce the binary size.

I manage to build a new binary, new size per ABI is roughly 30 MB, universal APK is 40MB.

That's an improvement 👍
Still quite an increase and too big for Izzy's repo, but well done regardless.

Is it possible to get the same coverage by using using a different library, e.g., exiftool? On my termux, that's ¼ the installation size of ffmpeg, but has a perl dependency, so might come out even?

The size its not comming only from ffmpeg, but also from the apache-poi library. It indeed could be a reeplacement as it supports a wide range of formats, but it wont help reducing the app size.

Someone mentioned a already made port for android in this issue and that one weights about 40MB, so our current solution is still even / maybe lighter,

@TPS
Copy link

TPS commented Aug 7, 2024

@Rashxz The thing about ffmpeg (oh, did you see #117?) is that it's bit overkill for this project, since we don't need >90% of its capabilities here, & ffmpeg-kit doesn't seem to allow for modular import of just the needed sections, so that's just frustrating bloat.

@TPS
Copy link

TPS commented Aug 7, 2024

@Rashxz Wait, maybe 1 can decrease that bloat.… Did you see https://github.com/arthenica/ffmpeg-kit/wiki/How-to-Decrease-Binary-Size?

@Rashxz
Copy link
Contributor

Rashxz commented Aug 7, 2024

@Rashxz Wait, maybe 1 can decrease that bloat.… Did you see https://github.com/arthenica/ffmpeg-kit/wiki/How-to-Decrease-Binary-Size?

Captura de pantalla 2024-08-07 a la(s) 9 34 58 a  m

Yes, I build a new binary with everything stripped. As you can see in the Image, ffmpeg takes 6.9MB of the total size. The rest is coming from all the other dependencies, being the biggest ones apache poi (for libre office) and iText (for pdf).

I will take a look on the dependencies to see if theres room for improvement.

@TPS
Copy link

TPS commented Aug 12, 2024

Yes, I build a new binary with everything stripped. As you can see in the Image, ffmpeg takes 6.9MB of the total size. The rest is coming from all the other dependencies, being the biggest ones apache poi (for libre office) and iText (for pdf).

@Rashxz I'm certain there's cheaper avenues to take for these. For pdf, may I suggest qpdf or cpdf as alternatives? I'll research for an alt for office docs, as well.

@TPS
Copy link

TPS commented Aug 12, 2024

Yes, I build a new binary with everything stripped. As you can see in the Image, ffmpeg takes 6.9MB of the total size. The rest is coming from all the other dependencies, being the biggest ones apache poi (for libre office) and iText (for pdf).

I'll research for an alt for office docs, as well.

@Rashxz I wonder if a separate dedicated utility is actually needed for LO? Per https://superuser.com/questions/1195338/what-metadata-does-a-libreoffice-file-contain-and-how-to-remove-it, it's matter of "just" deleting 1 file & 2 lines out of another out of the doc (as LO docs are actually zip archives of a certain structure).

@Rashxz
Copy link
Contributor

Rashxz commented Aug 12, 2024

Yes, I build a new binary with everything stripped. As you can see in the Image, ffmpeg takes 6.9MB of the total size. The rest is coming from all the other dependencies, being the biggest ones apache poi (for libre office) and iText (for pdf).

@Rashxz I'm certain there's cheaper avenues to take for these. For pdf, may I suggest qpdf or cpdf as alternatives? I'll research for an alt for office docs, as well.

Thanks

@Rashxz
Copy link
Contributor

Rashxz commented Aug 12, 2024

Yes, I build a new binary with everything stripped. As you can see in the Image, ffmpeg takes 6.9MB of the total size. The rest is coming from all the other dependencies, being the biggest ones apache poi (for libre office) and iText (for pdf).

I'll research for an alt for office docs, as well.

@Rashxz I wonder if a separate dedicated utility is actually needed for LO? Per https://superuser.com/questions/1195338/what-metadata-does-a-libreoffice-file-contain-and-how-to-remove-it, it's matter of "just" deleting 1 file & 2 lines out of another out of the doc (as LO docs are actually zip archives of a certain structure).

Sorry, I did not specify it well in my previous comment, that library is not just for LO but also for Microsoft office docs.

@TPS
Copy link

TPS commented Aug 22, 2024

@Rashxz How did 6928c9e effect APK/installed size?

@Rashxz
Copy link
Contributor

Rashxz commented Aug 22, 2024

@Rashxz How did 6928c9e effect APK/installed size?

I think its a ~2MB increase

@TPS
Copy link

TPS commented Aug 23, 2024

IIUC, #104 (comment) notes all this is blocked from landing in F-droid, so no way to see these improvements for such users.

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

No branches or pull requests

4 participants