roxen.lists.pike.general

Subject Author Date
Less filling (Re: Startup times Pike vs. Perl) Stephen R. van den Berg <srb[at]cuci[dot]nl> 19-08-2009
Just for the record, the (currently for me) best tradeof for running Pike on
an embedded system entails deleting all the precompiled *.o files *if* they
are larger than their corresponding source files, and if they are not
loaded a lot.  This currently means that I make an exception for
master.pike.o, since that makes a large difference, and possibly for any
extra modules which I notice I'm loading a lot.

The script I use to strip down the pike installation is:

#!/bin/sh

make MAKE_PARALLEL=-j5
make INSTALLARGS="--traditional" install

cd /usr/pike || exit 1

strip bin/pike

blocksize=1024

rm -rf \
 pike \
 doc \
 lib/pike/[0-9]* \
 include \
 bin/hilfe \
 bin/rsif \
 bin/pike.syms \
 lib/pike/modules/Tools.pmod/AutoDoc.pmod \
 lib/pike/modules/Tools.pmod/Shoot.pmod \
 lib/pike/modules/Tools.pmod/Monger.pmod \
 lib/pike/modules/Tools.pmod/PV.pmod \
 lib/pike/modules/Tools.pmod/sed.pmod \
 lib/pike/modules/Tools.pmod/Standalone.pmod \
 lib/pike/modules/Tools.pmod/Install.pmod* \
 lib/pike/modules/Tools.pmod/MasterHelp.pmod* \

# Delete these when not-deleting *.o files:
# lib/pike/modules/Tools.pmod/Legal.pmod/License.pmod/*.txt \
#

find lib -name '*.in' -print0 | xargs -0 rm -f

: >"lib/pike/master.pike"
touch "lib/pike/master.pike.o"

find lib/pike/modules -name '*.o' -print |
 sed -e \
 's/\.o$//' -e 's%\(.*\)%test -f  -a -f .o \&\& /bin/ls -l  .o%' |
 sh |
 while read d d d d size1 name1
 do
   read d d d d size2 name2
   set $name1
   while test $# -gt 1
   do shift
   done
   name1="$1"
   set $name2
   while test $# -gt 1
   do shift
   done
   name2="$1"
   if test $((($size1+$blocksize-1)/$blocksize)) -gt \
    $((($size2+$blocksize-1)/$blocksize))
   then
     : >"$name1"
     touch "$name2"
   else
     rm -f "$name2"
   fi
 done

exit 0
-- 
Sincerely,
           Stephen R. van den Berg.
Currently unemployed programmer:
"What do you mean, I can't initialize things in an assert()?"