4 texidoc
= "This file profiles property accesses; the log file shows the top properties examined.
5 Note: lilypond must be compiled with --disable-optimising for this file to work."
9 #(ly
:set-option
'profile-property-accesses
#t
)
13 \include "typography-demo.ly"
14 %\book { \score { {c4 } } }
16 #(define
(prop-stats
>? x y
)
18 ((> (cdr x
) (cdr y
)) #t
)
20 (symbol
<?
(car x
) (car y
)))
23 #(define
(display-stats what
)
27 (round-to
(lambda
(x
) (* rnd
(inexact-
>exact
(round
(/ x rnd
))))))
28 (alist
(map
(lambda
(entry
) (cons
(car entry
) (round-to
(cdr entry
)))) (hash-table-
>alist
(ly
:property-lookup-stats what
))))
29 (total
(apply +
(map cdr alist
)))
32 (set
! alist
(acons
'TOTAL total alist
))
34 (ly
:progress
"\n\n~A properties, top ~a rounded to ~a\n\n~a"
37 (map
(lambda
(x
) (format
"~30a: ~6@a" (car x
) (cdr x
)))
39 (sort alist prop-stats
>?
) count
))
44 #(display-stats
'prob
)
45 #(display-stats
'context
)
46 #(display-stats
'grob
)