2008-02-15 19:04:47 -05:00
|
|
|
USING: assocs words sequences arrays compiler tools.time
|
|
|
|
io.styles io prettyprint vocabs kernel sorting generator
|
2008-04-26 12:03:41 -04:00
|
|
|
optimizer math math.order ;
|
|
|
|
IN: optimizer.report
|
2008-02-15 19:04:47 -05:00
|
|
|
|
|
|
|
: count-optimization-passes ( nodes n -- n )
|
|
|
|
>r optimize-1
|
|
|
|
[ r> 1+ count-optimization-passes ] [ drop r> ] if ;
|
|
|
|
|
2008-06-09 03:14:14 -04:00
|
|
|
: results ( seq -- )
|
2008-04-26 00:17:08 -04:00
|
|
|
[ [ second ] prepose compare ] curry sort 20 tail*
|
2008-02-15 19:04:47 -05:00
|
|
|
print
|
|
|
|
standard-table-style
|
|
|
|
[
|
|
|
|
[ [ [ pprint-cell ] each ] with-row ] each
|
|
|
|
] tabular-output ;
|
|
|
|
|
2008-06-09 03:14:14 -04:00
|
|
|
: optimizer-report ( -- )
|
2008-06-28 03:36:20 -04:00
|
|
|
all-words [ compiled>> ] filter
|
2008-02-15 19:04:47 -05:00
|
|
|
[
|
|
|
|
dup [
|
|
|
|
word-dataflow nip 1 count-optimization-passes
|
2008-05-07 18:42:41 -04:00
|
|
|
] benchmark 2array
|
2008-02-15 19:04:47 -05:00
|
|
|
] { } map>assoc
|
|
|
|
[ first ] "Worst number of optimizer passes:" results
|
|
|
|
[ second ] "Worst compile times:" results ;
|
|
|
|
|
|
|
|
MAIN: optimizer-report
|