X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=buildscripts%2Fbuild-profile.sh;h=072cf64520c2fab1640a4e10502f833651bd370e;hb=b1c83a2eb01989406000b2ad828c9f9bcbffec3d;hp=b7ac93b6136407dd1dd31369bc5c4b17b59a7231;hpb=297afd09b9e7b76e1806411ad737496d59a4bb5b;p=lilypond.git diff --git a/buildscripts/build-profile.sh b/buildscripts/build-profile.sh index b7ac93b613..072cf64520 100755 --- a/buildscripts/build-profile.sh +++ b/buildscripts/build-profile.sh @@ -17,20 +17,71 @@ fi make conf=prof -j2 -rm -rf out-prof -mkdir out-prof -cd out-prof +if test "$?" != "0"; then + exit 2 +fi + +depth=../.. +resultdir=out/profile-results + +rm -rf $resultdir +mkdir $resultdir +cd $resultdir + + +cat > long-score.ly << EOF +\version "2.10.0" +foo = \new Staff \new Voice \repeat unfold 50 \relative { c4 d8[ d16( e]~ e16[ e e) f] g8 } +\score { + \new ChoirStaff << + \foo \foo \foo \foo + \foo \foo \foo \foo + + >> + \midi {} + \layout {} +} +EOF + +rm gmon.sum + +exe=$depth/out-prof/bin/lilypond + +## todo: figure out representative sample. +files="wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 mozart-hrn-3 mozart-hrn-3 long-score" + + + +$exe -ddump-profile --formats=ps -I $depth/input/ -I $depth/input/mutopia/J.S.Bach/ \ + -I $depth/input/mutopia/W.A.Mozart/ \ + $files + + +for a in *.profile; do + echo $a + cat $a +done + +echo 'running gprof' +gprof $exe > profile -echo 'foo = \new Staff \new Voice \repeat unfold 50 \relative { c4 d8[ d16( e]~ e16[ e e) f] g8 } -\new ChoirStaff << - \foo \foo \foo \foo - \foo \foo \foo \foo +exit 0 ->>' > long-score.ly +## gprof -s takes forever. +for a in seq 1 3; do + for f in $files ; do + $exe -ddump-profile --formats=ps -I $depth/input/ -I $depth/input/mutopia/J.S.Bach/ \ + -I $depth/input/mutopia/W.A.Mozart/ \ + $f -./bin/lilypond -ddump-profile -I ../input/ -I ../input/mutopia/J.S.Bach/ \ - -I ../input/mutopia/W.A.Mozart/ - wtk-fugue2 mozart-hrn-3 long-score + echo 'running gprof' + if test -f gmon.sum ; then + gprof -s $exe gmon.out gmon.sum + else + mv gmon.out gmon.sum + fi + done +done -gprof ./bin/lilypond +gprof $exe gmon.sum > profile