]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/build-profile.sh
update for build-profile.sh
[lilypond.git] / buildscripts / build-profile.sh
1 #!/bin/sh
2
3 if test "$1" == "--fresh"; then
4   fresh=yes
5 fi
6
7 if test ! -f config-prof.make; then
8   fresh=yes
9 fi
10
11 if test "$fresh" = "yes";
12 then
13   ./configure --enable-config=prof --enable-optimising \
14    &&   perl -i~ -pe 's/-pipe /-pg -pipe /g' config-prof.make \
15    &&   perl -i~ -pe 's/ -ldl / -pg -ldl /g' config-prof.make
16 fi
17
18 make conf=prof -j2
19
20
21 depth=../..
22 resultdir=out/profile-results
23
24 rm -rf $resultdir
25 mkdir $resultdir
26 cd $resultdir
27
28
29 echo 'foo = \new Staff \new Voice \repeat unfold 50 \relative { c4 d8[ d16( e]~ e16[ e e) f] g8  }
30 \new ChoirStaff << 
31   \foo \foo \foo \foo 
32   \foo \foo \foo \foo 
33
34 >>' > long-score.ly
35
36 rm gmon.sum
37
38 exe=$depth/out-prof/bin/lilypond
39
40 ## todo: figure out representative sample.
41 files="wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 mozart-hrn-3  mozart-hrn-3  long-score"
42
43 for a in seq 1 3; do
44   $exe -ddump-profile -I $depth/input/ -I  $depth/input/mutopia/J.S.Bach/ \
45      -I $depth/input/mutopia/W.A.Mozart/ \
46      $files 
47
48   if test -f gmon.sum ; then
49     gprof -s $exe gmon.out gmon.sum
50   else
51     mv gmon.out gmon.sum
52   fi 
53 done
54
55
56 for a in *.profile; do
57   echo $a
58   cat $a
59 done
60
61 gprof $exe gmon.sum > profile