tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: tcsh as csh default



On Fri, Oct 21, 2022 at 03:06:41PM +0200, Havard Eidnes wrote:
> There's a definite size difference between csh and tcsh,
> approximately 2x -- this is on NetBSD/amd64 9.x, and I include
> /bin/sh for comparison:
> 
> $ ls -lf /usr/pkg/bin/tcsh /bin/csh /bin/sh
> -rwxr-xr-x  1 root  wheel  408688 Jun 28 03:57 /usr/pkg/bin/tcsh
> -r-xr-xr-x  1 root  wheel  186712 Aug  4 17:30 /bin/csh
> -r-xr-xr-x  1 root  wheel  223632 Aug  4 17:30 /bin/sh
> $ size /usr/pkg/bin/tcsh /bin/csh /bin/sh
>    text    data     bss     dec     hex filename
>  382121   21158   86984  490263   77b17 /usr/pkg/bin/tcsh
>  144864    7113   21664  173641   2a649 /bin/csh
>  177881    6287    9928  194096   2f630 /bin/sh
> $
> 
> The size difference might not matter much for modern machines
> (and, yes, these are all dynamically linked).

Part of the difference is that both our /bin/sh and our /bin/csh are
linked against libedit, while tcsh has similar code built in.

Here are numbers from a sh4 machine running -current (where size does matter):

[~] martin@last-of-the-heroes > ls -lf /usr/pkg/bin/tcsh /bin/csh /bin/sh
-rwxr-xr-x  1 root  wheel  317548 Jul 21 21:40 /usr/pkg/bin/tcsh*
-r-xr-xr-x  1 root  wheel  172408 Oct 18 08:14 /bin/csh*
-r-xr-xr-x  1 root  wheel  200032 Oct 18 08:15 /bin/sh*
[~] martin@last-of-the-heroes > size /usr/pkg/bin/tcsh /bin/csh /bin/sh
   text    data     bss     dec     hex filename
 303581   11942   81684  397207   60f97 /usr/pkg/bin/tcsh
 142793    5237   20356  168386   291c2 /bin/csh
 171161    3620    5764  180545   2c141 /bin/sh
[~] martin@last-of-the-heroes > ldd /bin/csh 
/bin/csh:
        -ledit.3 => /lib/libedit.so.3
        -lterminfo.2 => /lib/libterminfo.so.2
        -lc.12 => /lib/libc.so.12
        -lgcc_s.1 => /lib/libgcc_s.so.1
        -lutil.7 => /lib/libutil.so.7
[~] martin@last-of-the-heroes > size /lib/libedit.so.3.1 
   text    data     bss     dec     hex filename
 160125    4452    7584  172161   2a081 /lib/libedit.so.3.1

Martin


Home | Main Index | Thread Index | Old Index