]> git.donarmstrong.com Git - lilypond.git/blob - scripts/auxiliar/build-profile.sh
Add '-dcrop' option to ps and svg backends
[lilypond.git] / scripts / auxiliar / 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 if test "$?" != "0"; then
21   exit 2
22 fi
23
24 depth=../..
25 resultdir=out/profile-results
26
27 rm -rf $resultdir
28 mkdir $resultdir
29 cd $resultdir
30
31
32 cat > long-score.ly << EOF
33 \version "2.10.0"
34 foo = \new Staff \new Voice \repeat unfold 50 \relative c' { c4 d8[ d16( e]~ e16[ e e) f] g8  }
35 \score {
36   \new ChoirStaff <<
37     \foo \foo \foo \foo
38     \foo \foo \foo \foo
39
40   >>
41   \midi {}
42   \layout {}
43 }
44 EOF
45
46 rm gmon.sum
47
48 exe=$depth/out-prof/bin/lilypond
49
50 ## todo: figure out representative sample.
51 files="wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 mozart-hrn-3  mozart-hrn-3  long-score"
52
53
54
55 $exe -ddump-profile --formats=ps -I $depth/input/ -I  $depth/input/mutopia/J.S.Bach/ \
56     -I $depth/input/mutopia/W.A.Mozart/ \
57     $files
58
59
60 for a in *.profile; do
61   echo $a
62   cat $a
63 done
64
65 echo 'running gprof'
66 gprof $exe > profile
67
68 exit 0
69
70
71 ## gprof -s takes forever.
72 for a in seq 1 3; do
73   for f in $files ; do
74     $exe -ddump-profile --formats=ps -I $depth/input/ -I  $depth/input/mutopia/J.S.Bach/ \
75        -I $depth/input/mutopia/W.A.Mozart/ \
76        $f
77
78     echo 'running gprof'
79     if test -f gmon.sum ; then
80       gprof -s $exe gmon.out gmon.sum
81     else
82       mv gmon.out gmon.sum
83     fi
84   done
85 done
86
87 gprof $exe gmon.sum > profile