From 1cbe87da82796e07c6ac2843176da16c225e9e83 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 7 May 2008 21:54:41 -0500 Subject: [PATCH] Fixes --- extra/tools/memory/memory.factor | 1 + extra/tools/time/time-docs.factor | 12 ++---------- extra/tools/time/time.factor | 22 +++++++++++++--------- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/extra/tools/memory/memory.factor b/extra/tools/memory/memory.factor index b8fdcab280..9628b218e9 100644 --- a/extra/tools/memory/memory.factor +++ b/extra/tools/memory/memory.factor @@ -36,6 +36,7 @@ IN: tools.memory [ first2 ] [ number>string "Generation " prepend ] bi* write-total/used/free ] 2each + "Decks" write-total "Cards" write-total ; : write-labelled-size ( n string -- ) diff --git a/extra/tools/time/time-docs.factor b/extra/tools/time/time-docs.factor index 46d356bef5..c0afa920c4 100644 --- a/extra/tools/time/time-docs.factor +++ b/extra/tools/time/time-docs.factor @@ -20,14 +20,6 @@ HELP: benchmark HELP: time { $values { "quot" "a quotation" } } -{ $description "Runs a quotation and then prints the total run time and time spent in the garbage collector." } -{ $examples - "This word can be used to compare performance of the non-optimizing and optimizing compilers." - $nl - "First, we time a quotation directly; quotations are compiled by the non-optimizing quotation compiler:" - { $unchecked-example "[ 1000000 0 [ + ] reduce drop ] time" "1116 ms run / 6 ms GC time" } - "Now we define a word and compile it with the optimizing word compiler. This results is faster execution:" - { $unchecked-example ": foo 1000000 0 [ + ] reduce ;" "\\ foo compile" "[ foo drop ] time" "202 ms run / 13 ms GC time" } -} ; +{ $description "Runs a quotation and then prints the total run time and some garbage collection statistics." } ; -{ gc-time benchmark millis time } related-words +{ benchmark millis time } related-words diff --git a/extra/tools/time/time.factor b/extra/tools/time/time.factor index 3ddea1b74d..bca5e3c573 100644 --- a/extra/tools/time/time.factor +++ b/extra/tools/time/time.factor @@ -9,15 +9,19 @@ IN: tools.time : stats. ( data -- ) { - "Run time" - "GC time" - "Nursery collections" - "Aging collections" - "Tenured collections" - "Cards checked" - "Cards scanned" - "Code literal collections" - } swap zip [ nip 0 > ] assoc-filter + "Run time (ms):" + "Nursery GC time (ms):" + "Nursery GC #:" + "Aging GC time (ms):" + "Aging GC #:" + "Tenured GC time (ms):" + "Tenured GC #:" + "Cards scanned:" + "Decks scanned:" + "Code literal GC #:" + "Bytes copied:" + "Bytes collected:" + } swap zip standard-table-style [ [ [