Counting Code: how big is Linux, anyway?


David Wheeler <www.dwheeler.com/> is the author of SLOCCount, a set of tools for counting physical Source Lines of Code (SLOC). Wheeler and others use these tools (offered under the GPL) to measure the code curb weight of Linux and its various parts. and the results have been published in several papers.

In More than a Gigabuck: Estimating GNU/Linux's Size, Wheeler offers these results for Red Hat Linux 7.1:

  1. Development Cost - $1 billion (a Gigabuck) by conventional proprietary methods in the U.S. (in year 2000 U.S. dollars).
  2. Size - More than 30 million physical source lines of code (SLOC). The largest single piece is the C language, at 17 million SLOC.
  3. Development Time - It would take about 8,000 person-years of development time, as determined using the widely-used basic COCOMO model.
  4. Size Growth - Red Hat Linux 7.1 represents over a 60% increase in size, effort, and traditional development costs over Red Hat Linux 6.2, which had 17 million SLOC.
  5. Languages - C comprised 71% of total language SLOC; C++ followed with 15%.
  6. Licenses - Over half the code is licensed under the GPL, and 63% are under copyleft licenses; the rest were MIT, distributable, BSD, MPL and public domain.

In Counting Potatoes: The size of Debian 2.2, Jesus M. Gonzalez-Barahona and others give these results (using Wheeler's tools):

  1. Development Cost - $1.892 billion
  2. Size - More than 55 million SLOC
  3. Development Time - More than 14,000 person years
  4. Languages - C comprised about 70%, C++ around 10%
  5. Packages - 2630 source packages, with a mean of about 21,300 SLOC per package (by contrast REd Hat 7.1 includes 612 packages and 49,000 SLOC per package).

From various sources, Counting Potatoes offers these comparitive SLOC curb weights:

More data and links to all these papers can be found at David Wheeler's SLOC page: <http://www.dwheeler.com/sloc/>.


- Doc Searls