Sunday, March 4, 2012

download sizes

I was watching a friend download Firefox 10 for her Mac and noticed that the download size was 78mb. I noticed because she (tried) to do the download while we were having breakfast, at a diner.  Not exactly the fastest internet around, so she ended up stopping the download any way.  And I had been the one to tell her to go ahead and download it, because I thought, 10 to 12mb at the most.

But 78mb for a web browser? WTF!?

So I went home and went to on my Linux computer, and downloaded the Linux version just to compare download sizes.  Of course I wouldn't really download it from Firefox's site normally, I'd just get it from the software manager on my computer, but I wanted to compare.

Well, on Linux, the download size is 16.2 mb. If I get it from my repository, it's even less (although Linux comes with Firefox already installed but that's just a detail).

16mb compared to 78mb is not something to sneeze at, so I compared more, and generally speaking this is very common. Sometimes the gap is huge and sometimes it's only about a quarter difference or half the difference, but there's usually a big difference in file size.

I asked some friends what was going on, and most of them didn't know, so then I asked some MOAR friends (programmer types) and they of course had the answer.  Don't quote me on this because I have no idea what it means and I could be explaining it wrong, but this is the basic gist.  Mac programs come packaged up in folders that are disguised as applican icons. That part I knew, because there's that old trick of "right-clicking" on an Application and choosing Show Contents, and you can see some of the things that go into making up an application on Mac.  But the reason they are bundled up in this way is because all applications need special code (called libraries) to run.  On Mac, all the libraries are bundled up INSIDE the application.

Now get this. If you have, say, Firefox, which needs a library called XUL, and then you download Thunderbird and it also needs XUL, then guess what?  Yes, you're downloading XUL twice.

That doesn't seem so bad until you start downloading XUL four times, and OPENCL 12 times, and FFTW 8 times and FFMPEG 15 times, ad infinitum.

In other words, imagine if Mac applications could tell in advance that you already have XUL and Gecko and all these other libraries, and so instead of making you download and store 78mb for Firefox, it only sent you 12mb.  And then Libre Office knew that you already had a bunch of Java stuff, so it only sent you 165mb instead of 225mb.  And Celtx, and VLC, and Filezilla, and Chromium, and so on!

Well, it doesn't really matter that much until you're running out of disk space, or you're on a slow internet connection and can't get what you need when you need it.

Interesting, right?

No comments:

Post a Comment