Reducing the size of AppImage

This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
looo
Posts: 2965
Joined: Mon Nov 11, 2013 5:29 pm

Re: Reducing the size of AppImage

Postby looo » Sat Sep 28, 2019 5:55 pm

It's disabled: weekly builds are done here:
https://github.com/looooo/freecad-feeds ... ild.sh#L40

The freecad variants stuff are experiments and is outdated.
please help with my conda-packaging efforts: https://liberapay.com/looooo/
User avatar
sgrogan
Posts: 5475
Joined: Wed Oct 22, 2014 5:02 pm

Re: Reducing the size of AppImage

Postby sgrogan » Sat Sep 28, 2019 6:04 pm

looo wrote:
Sat Sep 28, 2019 5:55 pm
The freecad variants stuff are experiments and is outdated.
Thanks, I've created a new desktop shortcut and set it to require admin to delete it. Perhaps now you won't have to keep refreshing my memory :oops:
What do you think of disabling the build by default in FreeCAD CMake?
looo
Posts: 2965
Joined: Mon Nov 11, 2013 5:29 pm

Re: Reducing the size of AppImage

Postby looo » Sat Sep 28, 2019 8:48 pm

sgrogan wrote:
Sat Sep 28, 2019 6:04 pm
Thanks, I've created a new desktop shortcut and set it to require admin to delete it. Perhaps now you won't have to keep refreshing my memory :oops:
What do you think of disabling the build by default in FreeCAD CMake?
Yes I am fine with outsourcing ship and plot finally. I will try take care of the external workbenches, so both work with latest FreeCAD. I had plans to optimize the plot module, but time is rare.

And sorry for my mess. I will try to clean the FreeCAD-conda repo a bit. Just for your information:
conda-forge/freecad-feedstock -> official releases
looooo/freecad-feedstock -> weekly builds

I did this to not waste conda-forge's ci time, but actually for azure time limitation is not a problem so theoretically we can move the weekly builds to conda-forge. For conda-forge it's also possible to keep all old build (no storage limitation). Currently for the freecad-organisation on anaconda.org we already store more than 3 GB (which is the official limit). I think the inofficial limit is 10gb.
please help with my conda-packaging efforts: https://liberapay.com/looooo/
User avatar
Kunda1
Posts: 5946
Joined: Thu Jan 05, 2017 9:03 pm

Re: Reducing the size of AppImage

Postby Kunda1 » Sat Sep 28, 2019 8:52 pm

looo wrote:
Sat Sep 28, 2019 8:48 pm
Yes I am fine with outsourcing ship and plot finally. I will try take care of the external workbenches, so both work with latest FreeCAD. I had plans to optimize the plot module, but time is rare.
Awesome. I wonder if this will speed up compile time at all ? (probably not because they're both python based WBs....right?)
Also, I wonder if this will make the AppImage 'weigh' less ?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
sgrogan
Posts: 5475
Joined: Wed Oct 22, 2014 5:02 pm

Re: Reducing the size of AppImage

Postby sgrogan » Sat Sep 28, 2019 9:01 pm

Kunda1 wrote:
Sat Sep 28, 2019 8:52 pm
Also, I wonder if this will make the AppImage 'weigh' less ?
This will be minor, but worthwhile anyway.
looo wrote:
Sat Sep 28, 2019 8:48 pm
Yes I am fine with outsourcing ship and plot finally. I will try take care of the external workbenches, so both work with latest FreeCAD. I had plans to optimize the plot module, but time is rare.
No worries. I will try to make a pull request tomorrow to make these not built by default. This will further break the PPA, but I will try to make a pull request for this as well.
looo wrote:
Sat Sep 28, 2019 8:48 pm
And sorry for my mess. I will try to clean the FreeCAD-conda repo a bit. Just for your information:
conda-forge/freecad-feedstock -> official releases
looooo/freecad-feedstock -> weekly builds
Thanks for the info. :)
triplus
Posts: 8802
Joined: Mon Dec 12, 2011 4:45 pm

Re: Reducing the size of AppImage

Postby triplus » Fri Oct 04, 2019 12:28 pm

In the next day or two i will add the suggested changes, need to test the recipes locally first. I noticed PyQt was added to FreeCAD 0.18 AppImage and that will get removed too. It isn't there anymore in FreeCAD 0.19 AppImage. As for further reducing the size. We likely don't need the whole VTK library, as i guess only a small subset is being used, for FreeCAD FEM purposes. Maybe we could figure out on what parts of the VTK could be removed. Other libraries, like some Python oriented ones, there we can't remove all that much, as developers will use them in different ways. We can't provide just the parts FreeCAD uses by default. Whenever we will embed the documentation, the documentation itself likely should be reduced a bit somehow.

Beyond doing all that i guess not much else we can't do about the AppImage size. That is if we don't want to start removing functionality.
triplus
Posts: 8802
Joined: Mon Dec 12, 2011 4:45 pm

Re: Reducing the size of AppImage

Postby triplus » Fri Oct 04, 2019 11:53 pm

OK, this is it:

FreeCAD 18 (embedded documentation):
  • Before: 537M
  • After: 521M

FreeCAD 19:
  • Before: 435MB
  • After: 373MB
FreeCAD 0.18 had PyQt and FreeCAD 0.19 had some Clang/LLVM libraries included. That likely isn't needed and i removed them, as some other stuff, like documentation, cmake and header files ... For removing more, that would come at the expanse of removing functionality. AppImages are now rather featureful. From all sorts of standard Python libraries, like NumPy, SciPy and there is Calculix, SolveSpace, OpenBLAS ... FreeeCAD, by default, doesn't use all of this, but if we remove parts of it, that likely will cause issues with external modules. I could reduce the size of VTK. I started the task, removing Python bindings and some other libraries, that would reduce the size (uncompressed) by lets say around 100MB. But that is still rather small gain, compared to the whole size, around 1.5GB. In addition you wouldn't be able to do this:

Code: Select all

import vtk 
VTK is one of the contenders, for possible future viewport purposes, therefore best to leave it as is, for now. Embedded documentation. Here things have some potential to improve. But that is out of scope and something that can get considered when creating FreeCAD 0.19 (offline) documentation.
User avatar
Kunda1
Posts: 5946
Joined: Thu Jan 05, 2017 9:03 pm

Re: Reducing the size of AppImage

Postby Kunda1 » Wed Oct 30, 2019 8:41 pm

Was looking at the SVGs in the FreeCAD source tree. I decided to do a search looking for all SVGs over +10k:

Code: Select all

find . -iname "*.svg" -size +10k -exec du -h {} \; | wc -l
Found 837
I wonder if we can optimize these SVG somehow subsequently further reducing the size of the AppImage ?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
triplus
Posts: 8802
Joined: Mon Dec 12, 2011 4:45 pm

Re: Reducing the size of AppImage

Postby triplus » Fri Nov 01, 2019 10:26 pm

If we would optimize all SVG files (upstream), we are talking about up to 2MB in size. Such efforts can be pursued by others, if desired. I personally don't see a point.