2 texidoc = "This file profiles property accesses; the log file shows the top properties examined."
6 #(ly:set-option 'profile-property-accesses #t)
10 %\include "../../input/typography-demo.ly"
11 \book { \score { {c4 } } }
13 #(define (prop-stats>? x y) (> (cdr x) (cdr y)))
15 #(define (display-stats what)
19 (alist (hash-table->alist (ly:property-lookup-stats what)))
20 (total (apply + (map cdr alist)))
23 (set! alist (acons 'TOTAL total alist))
25 (ly:progress "\n\n~A properties, top ~a rounded to ~a\n\n~a"
28 (map (lambda (x) (format "~30a: ~6@a" (car x) (* rnd (inexact->exact (round (/ (cdr x) rnd))))))
30 (sort alist prop-stats>?) count))
35 #(display-stats 'prob)
36 #(display-stats 'context)
37 #(display-stats 'grob)