Bootstrap and mason now record times in nanoseconds
parent
c55bdc0d34
commit
6a2cf3516d
|
@ -36,7 +36,7 @@ SYMBOL: bootstrap-time
|
||||||
all-words swap count number>string write ; inline
|
all-words swap count number>string write ; inline
|
||||||
|
|
||||||
: print-time ( us -- )
|
: print-time ( us -- )
|
||||||
1000 /i
|
1,000,000,000 /i
|
||||||
60 /mod swap
|
60 /mod swap
|
||||||
number>string write
|
number>string write
|
||||||
" minutes and " write number>string write " seconds." print ;
|
" minutes and " write number>string write " seconds." print ;
|
||||||
|
@ -84,14 +84,14 @@ SYMBOL: bootstrap-time
|
||||||
|
|
||||||
load-components
|
load-components
|
||||||
|
|
||||||
nano-count over - 1000000 /i core-bootstrap-time set-global
|
nano-count over - core-bootstrap-time set-global
|
||||||
|
|
||||||
run-bootstrap-init
|
run-bootstrap-init
|
||||||
|
|
||||||
f error set-global
|
f error set-global
|
||||||
f error-continuation set-global
|
f error-continuation set-global
|
||||||
|
|
||||||
nano-count swap - 1000000 /i bootstrap-time set-global
|
nano-count swap - bootstrap-time set-global
|
||||||
print-report
|
print-report
|
||||||
|
|
||||||
"deploy-vocab" get [
|
"deploy-vocab" get [
|
||||||
|
|
|
@ -46,7 +46,7 @@ PRIVATE>
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
[ [ 1array $vocab-link ] with-cell ]
|
[ [ 1array $vocab-link ] with-cell ]
|
||||||
[ 1000000000 /f pprint-cell ]
|
[ 1,000,000,000 /f pprint-cell ]
|
||||||
bi*
|
bi*
|
||||||
] with-row
|
] with-row
|
||||||
] assoc-each
|
] assoc-each
|
||||||
|
|
|
@ -2,7 +2,7 @@ IN: mason.common.tests
|
||||||
USING: prettyprint mason.common mason.config
|
USING: prettyprint mason.common mason.config
|
||||||
namespaces calendar tools.test io.files io.files.temp io.encodings.utf8 ;
|
namespaces calendar tools.test io.files io.files.temp io.encodings.utf8 ;
|
||||||
|
|
||||||
[ "00:01:01" ] [ 61000 milli-seconds>time ] unit-test
|
[ "00:01:02" ] [ 62,000,000,000 nanos>time ] unit-test
|
||||||
|
|
||||||
[ "/home/bobby/builds/factor" ] [
|
[ "/home/bobby/builds/factor" ] [
|
||||||
[
|
[
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
USING: kernel namespaces sequences splitting system accessors
|
USING: kernel namespaces sequences splitting system accessors
|
||||||
math.functions make io io.files io.pathnames io.directories
|
math.functions make io io.files io.pathnames io.directories
|
||||||
io.directories.hierarchy io.launcher io.encodings.utf8 prettyprint
|
io.directories.hierarchy io.launcher io.encodings.utf8 prettyprint
|
||||||
combinators.short-circuit parser combinators calendar
|
combinators.short-circuit parser combinators math calendar
|
||||||
calendar.format arrays mason.config locals debugger fry
|
calendar.format arrays mason.config locals debugger fry
|
||||||
continuations strings io.sockets ;
|
continuations strings io.sockets ;
|
||||||
IN: mason.common
|
IN: mason.common
|
||||||
|
@ -57,10 +57,8 @@ M: unix really-delete-tree delete-tree ;
|
||||||
} cleave
|
} cleave
|
||||||
] { } make [ pad-00 ] map "-" join ;
|
] { } make [ pad-00 ] map "-" join ;
|
||||||
|
|
||||||
: milli-seconds>time ( n -- string )
|
: nanos>time ( n -- string )
|
||||||
millis>timestamp
|
1,000,000,000 /i 60 /mod [ 60 /mod ] dip 3array [ pad-00 ] map ":" join ;
|
||||||
[ hour>> ] [ minute>> ] [ second>> floor ] tri 3array
|
|
||||||
[ pad-00 ] map ":" join ;
|
|
||||||
|
|
||||||
SYMBOL: stamp
|
SYMBOL: stamp
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ IN: mason.report
|
||||||
benchmark-time-file
|
benchmark-time-file
|
||||||
html-help-time-file
|
html-help-time-file
|
||||||
} [
|
} [
|
||||||
dup eval-file milli-seconds>time
|
dup eval-file nanos>time
|
||||||
[XML <tr><td><-></td><td><-></td></tr> XML]
|
[XML <tr><td><-></td><td><-></td></tr> XML]
|
||||||
] map [XML <h2>Timings</h2> <table><-></table> XML] ;
|
] map [XML <h2>Timings</h2> <table><-></table> XML] ;
|
||||||
|
|
||||||
|
|
|
@ -51,9 +51,6 @@ M: method-body word-vocabulary "method-generic" word-prop word-vocabulary ;
|
||||||
compiler-error-messages-file
|
compiler-error-messages-file
|
||||||
do-step ;
|
do-step ;
|
||||||
|
|
||||||
: benchmark-ms ( quot -- ms )
|
|
||||||
benchmark 1000000 /i ; inline
|
|
||||||
|
|
||||||
: check-boot-image ( -- )
|
: check-boot-image ( -- )
|
||||||
"" to-refresh drop 2dup [ empty? not ] either?
|
"" to-refresh drop 2dup [ empty? not ] either?
|
||||||
[
|
[
|
||||||
|
@ -67,11 +64,11 @@ M: method-body word-vocabulary "method-generic" word-prop word-vocabulary ;
|
||||||
".." [
|
".." [
|
||||||
bootstrap-time get boot-time-file to-file
|
bootstrap-time get boot-time-file to-file
|
||||||
check-boot-image
|
check-boot-image
|
||||||
[ do-load ] benchmark-ms load-time-file to-file
|
[ do-load ] benchmark load-time-file to-file
|
||||||
[ generate-help ] benchmark-ms html-help-time-file to-file
|
[ generate-help ] benchmark html-help-time-file to-file
|
||||||
[ do-tests ] benchmark-ms test-time-file to-file
|
[ do-tests ] benchmark test-time-file to-file
|
||||||
[ do-help-lint ] benchmark-ms help-lint-time-file to-file
|
[ do-help-lint ] benchmark help-lint-time-file to-file
|
||||||
[ do-benchmarks ] benchmark-ms benchmark-time-file to-file
|
[ do-benchmarks ] benchmark benchmark-time-file to-file
|
||||||
do-compile-errors
|
do-compile-errors
|
||||||
] with-directory ;
|
] with-directory ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue