How to reduce flatpak app size?

M. A. Spadaru maspadaru at gmail.com
Mon Aug 6 14:31:58 UTC 2018


*Hello again,*

*

Sorry for not being clear enough when describing my method. Here is a 
better description:


Test:

  *

    Read used disk space: d1

  *

    Install spotify

  *

    Run spotify + login + play “Manowar - Carry on”

  *

    Read used disk space: d2

  *

    Compute disk *footprint of* spotify as d2-d1

  *

    Install VSCore

  *

    Run VSCore + open an existing project folder + edit and save a file

  *

    Read used disk space: d3

  *

    Compute disk *footprint of* VSCode as d3-d2

  *

    Install telegram-desktop

  *

    Run telegram-desktop + login + send a message to a friend

  *

    Read used disk space: d4

  *

    Compute disk *footprint of* telegram-desktop as d4-d3

  *

    Install Gimp

  *

    Run Gimp + open an image

  *

    Read used disk space: d5

  *

    Compute disk *footprint of* Gimp as d5-d4

  *

    Install Android-Studio

  *

    Run Android-Studio + create new project + install sdk + run project

  *

    Read used disk space: d6

  *

    Compute disk footprint of *Android-Studio* as d6-d5


After a test I would uninstall the apps, dependencies, and 
settings/config files and any leftover files I could find, as best I 
could. Then proceed to the next test. I executed these 3 tests in this 
order: Native, Snap, Flatpak.

I read the used space on my disk using GParted. Since I have only one 
partition (except swap and /boot/efi), I think this method of computing 
the used disk space should cover any app files, dependencies, package 
format specific files and any config files added to /home. It should 
also over any files added by snapd and the core snap.


As pointed out by Alexander Larsson, my values seem to imply that I am 
starting from scratch downloading the runtimes for each flatpak 
application. However, this was not the case. When installing the GIMP 
flatpak, the flatpaks of Spotify, VSCode, and Telegram are already 
installed. Still GIMP needs 450MB of storage space.


I also expected that flatpak apps would share runtimes, however this 
does not seem to be the case. So, returning to my initial question: Is 
it possible to reduce the size of this overhead of each individual app? 
Maybe a way to force apps to share runtimes?


Cheers,

Mike

*
On 08/06/2018 11:14 AM, Muayyad AlSadi wrote:
> I guess the VSCode and alike require SDK runtime (having compiler, 
> headers ..etc) which is like *-devel host packages
> snap does not ship those
>
>
> On Mon, Aug 6, 2018 at 11:37 AM Alexander Larsson <alexl at redhat.com 
> <mailto:alexl at redhat.com>> wrote:
>
>     On Thu, Jul 12, 2018 at 9:05 AM, Mike Spadaru <maspadaru at gmail.com
>     <mailto:maspadaru at gmail.com>> wrote:
>     > Dear Flatpak community,
>     >
>     > I attempted a small experiment to benchmark Snap and Flatpak. On
>     > Ubuntu 16.04 I picked some apps: Spotify, VSCode, Telegram-Desktop,
>     > Gimp, Android-Studio. I performed three tests Native (via apt,
>     .deb or
>     > PPA), Snap and Flatpak. In each test I would read the used disk
>     space,
>     > install an app, run the app and perform a task (same task in each
>     > test), then read the used disk space again. Before moving to the
>     next
>     > test, I uninstalled all the apps and removed any config files
>     created.
>     >
>     > The machine uses only one disk partition. I also recorded CPU,
>     RAM and
>     > Power consumption, but there was no clear difference between the
>     three
>     > package formats.  My results for the disk usage are shown bellow.
>     > Values are in mega-bytes:
>     >
>     > | App | Native | Snap | Flatpak |
>     > | Spotify | 240 | 290 | 980 |
>     > | VSCode | 270 | 220 | 1030 |
>     > | Telegram | 80 | 100 | 600 |
>     > | Gimp | 80 | 200 | 450 |
>     > | Android Studio | 3290 | 3330 | 5930 |
>
>     This is not really a fair comparison. You already have basically all
>     the dependencies of the native packages installed, so installing just
>     the app is just going to measure the app itself, whereas the flatpak
>     application will download the dependencies (the runtime) in addition
>     to the app.
>     The same happens for snap, i.e. since you're on ubuntu it will already
>     have installed the ubuntu core snap, so you're not counting that space
>     against the app.
>
>     Also, the values you get seem to imply that you're starting from
>     scratch downloading the runtimes for each flatpak application, but
>     most apps share the runtimes so if you were to install all the
>     flatpaks at the same time the total size would not add up to the sum
>     of your measured sizes.
>
>     A better test of snap/flatpak might be to first remove all of snapd,
>     including all snaps (thus also the core snap), then measure the free
>     space, install snapd + al* the above snaps and compare the free size
>     with before. Then do the same with all flatpaks in one install.
>     That way you will count shared things only once, and accurately
>     include the size of the snap base in the comparison.
>     _______________________________________________
>     Flatpak mailing list
>     Flatpak at lists.freedesktop.org <mailto:Flatpak at lists.freedesktop.org>
>     https://lists.freedesktop.org/mailman/listinfo/flatpak
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/flatpak/attachments/20180806/b3349631/attachment-0001.html>


More information about the Flatpak mailing list