> If I was looking for ways to reduce space I would probably
> start with vlrt.c and pool.c

the quick linker changes i did this morning discard various
commonly unused functions in vlrt.c, and sometimes in pool.c.
it saves 12% on text and data for something simple like cat.c but as one might
expect it saves less and less as a percentage of
bigger things like plan 9 and inferno kernels (eg 1.4% or so).
i haven't tabulated savings overall.

a few represent obsolete things that could simply be removed,
but in quite a few cases (eg, atexit and canlock below) the relevant source
files have several functions (often to use internal functions and data marked 
static)
and in any given load some of them aren't used (eg, rc4skip and rc4back in 
rc4.c).
on the other hand, partly because of the simple-minded implementation,
it adds a bit to the linking time when used, notably on the kernels.

here's the list for cat.c
        atexit unused
        atexitdont unused
        canlock unused
        atoi unused
        _d2v unused
        _f2v unused
        _v2d unused
        _v2f unused
        vneg unused
        _divv unused
        _modv unused
        _rshav unused
        _rshlv unused
        _lshv unused
        _andv unused
        _orv unused
        _xorv unused
        _vpp unused
        _vmm unused
        _ppv unused
        _mmv unused
        _p2v unused
        _sl2v unused
        _ul2v unused
        _si2v unused
        _ui2v unused
        _sh2v unused
        _uh2v unused
        _sc2v unused
        _uc2v unused
        _v2sc unused
        _v2uc unused
        _v2sh unused
        _v2uh unused
        _v2sl unused
        _v2ul unused
        _v2si unused
        _v2ui unused
        _testv unused
        _eqv unused
        _nev unused
        _ltv unused
        _lev unused
        _gtv unused
        _gev unused
        _lov unused
        _lsv unused
        _hiv unused
        _hsv unused
        runenlen unused
        fmtfdflush unused
        fmtinstall unused
        _mulv unused
        _addv unused
        toupper unused
        modf unused
        muldiv unused
        $0.0 unused (data)
but that amounts to only 2844 bytes overall of the original 23110.
by the time you get to the kernels, you're talking real savings of, ooh, 30k
out of 1.7mbytes (text+data+bss).  it's slightly more helpful with inferno
than plan 9, because the kernel includes more library code, and sometimes that
includes functions that could be called to dump data structures when debugging
but aren't referenced normally.

Reply via email to