tools.time: remove crappy old GC stats
parent
d95a98eb9c
commit
21f1fe7aaf
|
@ -6,12 +6,9 @@ ARTICLE: "timing" "Timing code"
|
||||||
{ $subsections time }
|
{ $subsections time }
|
||||||
"A lower-level word puts timings on the stack, intead of printing:"
|
"A lower-level word puts timings on the stack, intead of printing:"
|
||||||
{ $subsections benchmark }
|
{ $subsections benchmark }
|
||||||
"You can also read the system clock and garbage collection statistics directly:"
|
"You can also read the system clock directly:"
|
||||||
{ $subsections
|
{ $subsections micros }
|
||||||
micros
|
{ $see-also "profiling" "calendar" } ;
|
||||||
gc-stats
|
|
||||||
}
|
|
||||||
{ $see-also "profiling" } ;
|
|
||||||
|
|
||||||
ABOUT: "timing"
|
ABOUT: "timing"
|
||||||
|
|
||||||
|
@ -23,6 +20,6 @@ HELP: benchmark
|
||||||
|
|
||||||
HELP: time
|
HELP: time
|
||||||
{ $values { "quot" "a quotation" } }
|
{ $values { "quot" "a quotation" } }
|
||||||
{ $description "Runs a quotation and then prints the total run time and some garbage collection statistics." } ;
|
{ $description "Runs a quotation and then prints the total run time and some statistics." } ;
|
||||||
|
|
||||||
{ benchmark micros time } related-words
|
{ benchmark micros time } related-words
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
! Copyright (C) 2003, 2008 Slava Pestov.
|
! Copyright (C) 2003, 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel math memory io io.styles prettyprint
|
USING: kernel math memory io io.styles prettyprint
|
||||||
namespaces system sequences splitting grouping assocs strings
|
namespaces system sequences splitting grouping assocs strings
|
||||||
|
@ -11,64 +11,28 @@ IN: tools.time
|
||||||
: time. ( time -- )
|
: time. ( time -- )
|
||||||
"== Running time ==" print nl 1000000 /f pprint " seconds" print ;
|
"== Running time ==" print nl 1000000 /f pprint " seconds" print ;
|
||||||
|
|
||||||
: gc-stats. ( stats -- )
|
|
||||||
5 cut*
|
|
||||||
"== Garbage collection ==" print nl
|
|
||||||
"Times are in microseconds." print nl
|
|
||||||
[
|
|
||||||
6 group
|
|
||||||
{
|
|
||||||
"GC count:"
|
|
||||||
"Total GC time:"
|
|
||||||
"Longest GC pause:"
|
|
||||||
"Average GC pause:"
|
|
||||||
"Objects copied:"
|
|
||||||
"Bytes copied:"
|
|
||||||
} prefix
|
|
||||||
flip
|
|
||||||
{ "" "Nursery" "Aging" "Tenured" } prefix
|
|
||||||
simple-table.
|
|
||||||
]
|
|
||||||
[
|
|
||||||
nl
|
|
||||||
{
|
|
||||||
"Total GC time:"
|
|
||||||
"Cards scanned:"
|
|
||||||
"Decks scanned:"
|
|
||||||
"Card scan time:"
|
|
||||||
"Code heap literal scans:"
|
|
||||||
} swap zip simple-table.
|
|
||||||
] bi* ;
|
|
||||||
|
|
||||||
: dispatch-stats. ( stats -- )
|
: dispatch-stats. ( stats -- )
|
||||||
"== Megamorphic caches ==" print nl
|
"== Megamorphic caches ==" print nl
|
||||||
{ "Hits" "Misses" } swap zip simple-table. ;
|
{ "Hits" "Misses" } swap zip simple-table. ;
|
||||||
|
|
||||||
: inline-cache-stats. ( stats -- )
|
: inline-cache-stats. ( stats -- )
|
||||||
nl "== Polymorphic inline caches ==" print nl
|
"== Polymorphic inline caches ==" print nl
|
||||||
3 cut
|
3 cut
|
||||||
[
|
[
|
||||||
"Transitions:" print
|
"- Transitions:" print
|
||||||
{ "Cold to monomorphic" "Mono to polymorphic" "Poly to megamorphic" } swap zip
|
{ "Cold to monomorphic" "Mono to polymorphic" "Poly to megamorphic" } swap zip
|
||||||
simple-table. nl
|
simple-table. nl
|
||||||
] [
|
] [
|
||||||
"Type check stubs:" print
|
"- Type check stubs:" print
|
||||||
{ "Tag only" "Hi-tag" "Tuple" "Hi-tag and tuple" } swap zip
|
{ "Tag only" "Hi-tag" "Tuple" "Hi-tag and tuple" } swap zip
|
||||||
simple-table.
|
simple-table.
|
||||||
] bi* ;
|
] bi* ;
|
||||||
|
|
||||||
: time ( quot -- )
|
: time ( quot -- )
|
||||||
gc-reset
|
|
||||||
reset-dispatch-stats
|
reset-dispatch-stats
|
||||||
reset-inline-cache-stats
|
reset-inline-cache-stats
|
||||||
benchmark gc-stats dispatch-stats inline-cache-stats
|
benchmark dispatch-stats inline-cache-stats
|
||||||
H{ { table-gap { 20 20 } } } [
|
[ time. nl ]
|
||||||
[
|
[ dispatch-stats. nl ]
|
||||||
[ [ time. ] 3dip ] with-cell
|
[ inline-cache-stats. ]
|
||||||
[ ] with-cell
|
tri* ; inline
|
||||||
] with-row
|
|
||||||
[
|
|
||||||
[ [ gc-stats. ] 2dip ] with-cell
|
|
||||||
[ [ dispatch-stats. ] [ inline-cache-stats. ] bi* ] with-cell
|
|
||||||
] with-row
|
|
||||||
] tabular-output nl ; inline
|
|
||||||
|
|
Loading…
Reference in New Issue