4 texidoc = "This file profiles property accesses; the log file shows the top properties examined."
8 #(ly:set-option 'profile-property-accesses #t)
12 \include "../../input/typography-demo.ly"
13 %\book { \score { {c4 } } }
15 #(define (prop-stats>? x y)
17 ((> (cdr x) (cdr y)) #t)
19 (symbol<? (car x) (car y)))
22 #(define (display-stats what)
26 (round-to (lambda (x) (* rnd (inexact->exact (round (/ x rnd))))))
27 (alist (map (lambda (entry) (cons (car entry) (round-to (cdr entry)))) (hash-table->alist (ly:property-lookup-stats what))))
28 (total (apply + (map cdr alist)))
31 (set! alist (acons 'TOTAL total alist))
33 (ly:progress "\n\n~A properties, top ~a rounded to ~a\n\n~a"
36 (map (lambda (x) (format "~30a: ~6@a" (car x) (cdr x)))
38 (sort alist prop-stats>?) count))
43 #(display-stats 'prob)
44 #(display-stats 'context)
45 #(display-stats 'grob)