Positive, comparative, and the code used in a linux

I read a thread where OpenBSD community were discussing the code for the network time daemon, and some figures stated there seemed almost unreal. Out of the pure curiosity, that has nothing to do with deeper understanding of the ntp daemon code, I ran “a test” used there on an OpenBSD, a FreeBSD and a Linux machine. The results are truly staggering:

uname -rms ; pwd ; for i in $(find . -name “*.[ch]”); do cat $i >> allcode; done ; egrep -v ‘[:blank:]*/?\*’ allcode | grep -v “^ *$” | wc -l
OpenBSD 5.6 amd64
/usr/src/usr.sbin/ntpd
2898

uname -rms ; pwd ; for i in $(find . -name “*.[ch]”); do cat $i >> allcode; done ; egrep -v ‘[:blank:]*/?\*’ allcode | grep -v “^ *$” | wc -l
FreeBSD 11.0-CURRENT amd64
/usr/src/contrib/ntp/ntpd
40055

uname -rms ; pwd ; for i in $(find . -name “*.[ch]”); do cat $i >> allcode; done ; egrep -v ‘[[:blank:]]*/?\*’ allcode | grep -v “^ *$” | wc -l
Linux 3.17.6-200.fc20.x86_64 x86_64
/tmp/ntp-4.2.8/ntpd
102214

Project OpenBSD proved itself time and again as a proper place if you want to learn coding!

One thought on “Positive, comparative, and the code used in a linux

  1. Vanja Post author

    A quick correction before it is too late, regarding the Fedora’s ntp source “testing”: I used the source code from the ntp’s site. However, testing the code that is delivered in the srpm for Fedora, ntp-4.2.6p5-17.fc20.src.rpm, gave slightly “better” results – the ntp-4.2.6p5-17.fc20.src has 46854 lines of code for the ntp daemon.

    Still, the conclusion stays, because all of those daemons have exactly the same role, and most of those found in the systems are a magnitude bigger than the OpenBSD’s one.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *