From da716ed6ec7196fddcf3fc8a86b89bf85cc755dc Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 15 Feb 2008 18:04:47 -0600 Subject: [PATCH] Rename benchmark.compiler to optimizer.report --- extra/benchmark/compiler/compiler.factor | 17 -------------- extra/optimizer/report/report.factor | 28 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 17 deletions(-) delete mode 100755 extra/benchmark/compiler/compiler.factor create mode 100755 extra/optimizer/report/report.factor diff --git a/extra/benchmark/compiler/compiler.factor b/extra/benchmark/compiler/compiler.factor deleted file mode 100755 index 12ac9b8041..0000000000 --- a/extra/benchmark/compiler/compiler.factor +++ /dev/null @@ -1,17 +0,0 @@ -IN: benchmark.compiler -USING: assocs words sequences arrays compiler tools.time -io.styles io prettyprint vocabs kernel sorting generator -optimizer ; - -: recompile-with-timings - all-words [ compiled? ] subset - [ dup [ word-dataflow optimize nip drop ] benchmark nip ] { } map>assoc - sort-values 20 tail* - "Worst offenders:" print - standard-table-style - [ - [ [ "Word" write ] with-cell [ "Compile time (ms)" write ] with-cell ] with-row - [ [ [ pprint-cell ] each ] with-row ] each - ] tabular-output ; - -MAIN: recompile-with-timings diff --git a/extra/optimizer/report/report.factor b/extra/optimizer/report/report.factor new file mode 100755 index 0000000000..6655d9dcf3 --- /dev/null +++ b/extra/optimizer/report/report.factor @@ -0,0 +1,28 @@ +IN: optimizer.report +USING: assocs words sequences arrays compiler tools.time +io.styles io prettyprint vocabs kernel sorting generator +optimizer ; + +: count-optimization-passes ( nodes n -- n ) + >r optimize-1 + [ r> 1+ count-optimization-passes ] [ drop r> ] if ; + +: word-table + [ [ second ] swap compose compare ] curry sort 20 tail* + print + standard-table-style + [ + [ [ [ pprint-cell ] each ] with-row ] each + ] tabular-output ; + +: optimizer-report + all-words [ compiled? ] subset + [ + dup [ + word-dataflow nip 1 count-optimization-passes + ] benchmark nip 2array + ] { } map>assoc + [ first ] "Worst number of optimizer passes:" results + [ second ] "Worst compile times:" results ; + +MAIN: optimizer-report