Skip to content
seventh edited this page Sep 13, 2010 · 8 revisions

Single measure

Here are a few measures I ran on my x86/64 system lately on the linux kernel 2.6.34 archive:

tool version C (loc) C++ (loc) total (loc) time (s)
codemetre 0.28.0 8,102,601 1,500 8,104,101 24
sloccount 2.26 8,103,841 3,332 8,107,173 71 (48)
cloc 1.51 8,120,930 1,500 8,122,430 218

sloccount uses sophisticated heuristics to determine the language in which is written a file. It also recognizes much more languages. This may explain why measures are similar but not identical. Nevertheless, what can be noticed is that codemetre is almost three times faster than sloccount! What have to be said is that sloccount builds a database of files in order to be much faster when called more than once. In this case, sloccount gets faster as it reuses precedent results, but codemetre keeps being twice as fast.

cloc is desperately slow, and it still gives almost 15,000 loc more than other tools (previous tools comparison showed that this is a recurrent flaw of cloc), even though it determines duplicates. This is a strange result.

Differential measure

I also wanted to compare 2.4.37 and 2.6.34 flavours of the linux kernel archives. So I used the following command with 0.28.0 release:

codemetre --status --diff --short linux.2.4.37/ linux.2.6.34/

On my x86/64 system, the command took less than 1 minute and a half to execute! The result is that between these two versions (and among the files recognized by codemetre):

  • 32,788 files have changed
  • 7,077,817 lines have been written (N-C)
  • 2,381,764 lines of the ancient version have been reworked or removed (A-C)
  • Kernel has grown up of 4,696,053 lines (N-A)

Clone this wiki locally