Review Rules and staticly linked packages agains dietlibc

Enrico Scholz enrico.scholz at informatik.tu-chemnitz.de
Fri Feb 24 16:29:34 UTC 2006


j.w.r.degoede at hhs.nl (Hans de Goede) writes:

> I for one am still far from convinced what exactly are those effiecency
> gains, numbers please.

ok, I executed the following sequence:

for i in `seq 0 10`; do
  for F in ds glibc diet; do
    echo "$F/$i" ;
    { time /tmp/tcpsvd.$F 127.0.0.1 1024 ~/tmp/r & } &>/tmp/res.$F.$i ;
    ~/tmp/s 10000 50 127.0.0.1 1024;
    killall tcpsvd.$F;
    wait;
  done;
done

which

* executes a static dietlibc linked 'tcpsvd.ds' (F=='ds'), a dynlinked
  dietlibc 'tcpsvd.diet' (F=='diet') and a glibc linked 'tcpsvd.glibc'
  (F=='glibc')

* tcpsvd listens on localhost, port 1024 and executes program ~/tmp/r

* ~/tmp/s makes 10000 requests as fast as possible but not more than 50
  at the same time

* all this will be done 11 times for each $F

* results will be stored into /tmp/res.{diet,ds,glibc}.$RUN


This gives the following numbers (values of static linked dietlibc are
assumed as 100%):


user-time:
  res.ds.*      res.diet.*      res.glibc.*
  0m0.000s(#)   0m0.260s        0m0.356s
  0m0.180s      0m0.308s        0m0.344s
  0m0.220s      0m0.300s        0m0.348s
  0m0.160s      0m0.328s        0m0.364s
  0m0.212s      0m0.288s        0m0.404s
  0m0.208s      0m0.296s        0m0.332s
  0m0.148s      0m0.348s        0m0.280s
  0m0.172s      0m0.308s        0m0.304s
  0m0.224s      0m0.324s        0m0.292s
  0m0.212s      0m0.312s        0m0.368s
  0m0.212s      0m0.280s        0m0.352s
  --------------------------------------
  0m0.195s      0m0.305s        0m0.340s
  100%          156%            175%

sys-time
  res.ds.*      res.diet.*      res.glibc.*
  0m0.000s(#)   0m1.516s        0m2.248s
  0m1.212s      0m1.748s        0m2.124s
  0m1.512s      0m1.412s        0m2.160s
  0m1.296s      0m1.672s        0m2.204s
  0m1.240s      0m1.764s        0m2.192s
  0m1.340s      0m1.748s        0m2.132s
  0m1.444s      0m1.716s        0m1.944s
  0m1.612s      0m1.720s        0m1.980s
  0m1.428s      0m1.808s        0m1.924s
  0m1.492s      0m1.804s        0m1.968s
  0m1.480s      0m1.640s        0m2.120s
  --------------------------------------
  0m1.406s      0m1.686s        0m2.090s
  100%          119%            149%

(#) ... socket was blocked by older process; ignored

The 'real' times were omitted because they are having a very high
variance; see http://ensc.de/diet/ for the values


Comparing static sizes:

$ ls -l tcpsvd.{ds,diet,glibc}
-rwxr-xr-x  1 ensc ensc 38788 23. Feb 23:28 tcpsvd.diet         100%
-rwxr-xr-x  1 ensc ensc 33308 24. Feb 00:26 tcpsvd.ds            86%
-rwxr-xr-x  1 ensc ensc 47352 23. Feb 23:29 tcpsvd.glibc        122%

$ ps u
     VSZ   RSS                                                   VSZ%   RSS%
...  132    44 pts/20   S+   17:05   0:00 /tmp/tcpsvd.ds ...     100%   100%
...  324   160 pts/20   S+   17:06   0:00 /tmp/tcpsvd.diet ...   245%   364%
... 1636   500 pts/20   S+   17:14   0:00 /tmp/tcpsvd.glibc ... 1239%  1136%  



As you can see, the static dietlibc linked application outperforms both
the dynamic linked and especially the glibc linked version significantly.


Environment: FC4, P4 2.8GHz HT, 1GB RAM

The 'r' and 's' programs were built with 'diet -Os gcc ...' and are
available at

          http://ensc.de/diet/r.c and http://ensc.de/diet/s.c




Enrico




More information about the fedora-extras-list mailing list