Size of Chromium codebase

2,978 views
Skip to first unread message

Anirudh S

unread,
Jan 1, 2011, 8:40:11 AM1/1/11
to Chromium-discuss
I would like to know why the source code of Chromium is huge when
compared to the actual size of the browser software. Is it because,
building Chromium means we would have to install some dependencies as
well ?

I think I'm missing something important while trying to understand
this. Can someone help me out ?

Cheers,
-Anirudh

ManDay

unread,
Jan 2, 2011, 7:17:57 AM1/2/11
to Chromium-discuss
I would also be interested in the answer to this question. 132
Megabytes plus unconditional dependencies on several GNOME-libraries -
I wanted to give Chromium a try but I'm certainly not going to let
this happen to my computer, sadly.

Mohamed Mansour

unread,
Jan 2, 2011, 11:44:04 AM1/2/11
to anirudh...@gmail.com, Chromium-discuss
Hi Anirudh,

There are many factors why the actual size of the browser is small compared to the source code.
  • Comments (Chromium has around 20-30% of the source commented. We comment everything, from JavaScript, to C++)
  • Test Data (There is "alot" of test data, layout tests, unit tests, browser tests, etc, and test binary/ascii data itself,)
  • Tools (Some tools are bundled up together like python, git, coverity, valgrind, etc)
  • Cross-Platform (We support ChromeOS, Mac, Windows, and Linux, you just compile what you use)
  • Repository Database (If you checked out using SVN, I believe size almost doubles or triples, you can Google why. If you cloned with Git, it is marginally smaller, but it is still heavy) I might be wrong though.
  • Optimizations (The compiler optimizes code, not enough experience in that part.)
So lets look at an example for Windows, if you look at the core browser code in src/chrome, you will notice the following:
  • The size of the folder is ~1.1 GB (my early clone)
  • The test data is around ~900MB
  • The Linux, Mac, and ChromeOS files take around ~100MB
  • Comments around ~30%.
That leaves around ~100MB (excluding compiler optimizations), I don't know how well it compresses, images, files, etc. So from 1.1GB till 100MB by just removing the stuff that interferes. I didn't include the repo, because the .git folder is outside the src/chrome folder.
 
I hope that helped answer your question a little. Take a look at this superb widget made by Evan Martin, it is a treemap that shows how many bytes do our various bits of code contribute to the final executable. http://neugierig.org/software/chromium/bloat/

There might be a many more reasons, but with my little experience in the language, that is what I could come up with. Any else can contribute more :)

Kind regards,
Mohamed Mansour




--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
   http://groups.google.com/a/chromium.org/group/chromium-discuss

vasa1

unread,
Jan 3, 2011, 2:30:54 AM1/3/11
to Chromium-discuss

Thank you for such a courteous response! It makes sense even to
someone who isn't on the inside of things. Much appreciated!
Reply all
Reply to author
Forward
0 new messages