How will we restart civilization after we defeat Skynet? A key part of this will be getting Google back up and running. What’s the value of life without kitten videos?
The Visual Capitalist recently published an interesting graph comparing the lines of code that were needed to create various software.
At the top of the chart you have things like Unix 1.0 (<20K), PhotoShop 1.0 (100K), Space Shuttle (400K).
At the bottom you have the big boys like MicroSoft Office (45MM), FaceBook (60MM), Mac OS X (85MM).
The standout is the last entry, Google clocking in at 2 billion. This makes for an eye catching graphic. This is all of Google. It includes all of Google’s applications and services, Chrome, YouTube, Android, Search, all of it. This is only the code needed to run all that and not the mountains of data that Google manages.
My question is, how much space, both code and application does all this take up. Understanding that these applications spread across thousands of servers and millions (billions?) of devices. In a post-apocalyptic, Book of Eli wasteland what does our protagonist need to carry with him in his search for the legendary lost server farm?
This is an important answer if you want this movie to make any sense at all.
Here is my analysis. We need to figure out two basic formulas. We need a formula that can calculate application size from lines of code count and one that calculates storage space for the source code.
Application Storage Space
Understanding that there will be many variables that influence application size. Is the application interpreted, compiled code or some virtual machine? Since this is for movie research, I will simply look for a basic linear relationship between lines of code and applications size and ignore those issues.
I’ve been working on a small A.I. project. Shameless plug – http://danlovy.com/critter/
That application has about 5K lines of code and takes about 200K of application space. That gives a ratio of about 40 to 1.
Lines Of Code X 40 = Application Space.
Let’s test this formula. It’s been reported that Windows 10 is approximately 50 million lines of code. The Windows 10 download is about 2 gig. Son-of-gun, the formula works. This file size is compressed but I assume Mad Max would compress the files. So far so good.
The chart shows the Android operating system at 12 million lines of code. That works out to 4.8 gig. Without knowing which version of Android this line count is referring to, that number is in the right ball park.
Firefox is listed at 1 million lines of code. The mozilla support site says that Firefox will take 60 MB of storage. Still, though a little high, we are in the ball park. Close enough for the movie business.
Source Code Storage
Going back to my poorly documented application, I have an average of 50 bytes per line of code. I have no way to look at the code density of any of the applications listed. However, 50 seems about right, at least for our movie research purposes.
So, How Much Space Would Google Take.
Using these well researched formulas and based on the reported 2 billion lines of code we get
Application Storage Requirements – 80 GB
Source Code Storage Requirements – 100 GB
Well, that will easily fit on a 256 GB USB Stick ($80) with plenty of space left over for installation instructions and a video message from Elon Musk’s clone wishing ‘good luck’ to mankind.
If you find yourself on Fury Road and you encounter someone in a dusty leather jacket, defending a USB thumb drive with his life, let him pass, let him pass.