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
|
||||
|
||||
: print-time ( us -- )
|
||||
1000 /i
|
||||
1,000,000,000 /i
|
||||
60 /mod swap
|
||||
number>string write
|
||||
" minutes and " write number>string write " seconds." print ;
|
||||
|
@ -84,14 +84,14 @@ SYMBOL: bootstrap-time
|
|||
|
||||
load-components
|
||||
|
||||
nano-count over - 1000000 /i core-bootstrap-time set-global
|
||||
nano-count over - core-bootstrap-time set-global
|
||||
|
||||
run-bootstrap-init
|
||||
|
||||
f error 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
|
||||
|
||||
"deploy-vocab" get [
|
||||
|
|
|
@ -46,7 +46,7 @@ PRIVATE>
|
|||
[
|
||||
[
|
||||
[ [ 1array $vocab-link ] with-cell ]
|
||||
[ 1000000000 /f pprint-cell ]
|
||||
[ 1,000,000,000 /f pprint-cell ]
|
||||
bi*
|
||||
] with-row
|
||||
] assoc-each
|
||||
|
|
|
@ -2,7 +2,7 @@ IN: mason.common.tests
|
|||
USING: prettyprint mason.common mason.config
|
||||
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" ] [
|
||||
[
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
USING: kernel namespaces sequences splitting system accessors
|
||||
math.functions make io io.files io.pathnames io.directories
|
||||
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
|
||||
continuations strings io.sockets ;
|
||||
IN: mason.common
|
||||
|
@ -57,10 +57,8 @@ M: unix really-delete-tree delete-tree ;
|
|||
} cleave
|
||||
] { } make [ pad-00 ] map "-" join ;
|
||||
|
||||
: milli-seconds>time ( n -- string )
|
||||
millis>timestamp
|
||||
[ hour>> ] [ minute>> ] [ second>> floor ] tri 3array
|
||||
[ pad-00 ] map ":" join ;
|
||||
: nanos>time ( n -- string )
|
||||
1,000,000,000 /i 60 /mod [ 60 /mod ] dip 3array [ pad-00 ] map ":" join ;
|
||||
|
||||
SYMBOL: stamp
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ IN: mason.report
|
|||
benchmark-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]
|
||||
] 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
|
||||
do-step ;
|
||||
|
||||
: benchmark-ms ( quot -- ms )
|
||||
benchmark 1000000 /i ; inline
|
||||
|
||||
: check-boot-image ( -- )
|
||||
"" 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
|
||||
check-boot-image
|
||||
[ do-load ] benchmark-ms load-time-file to-file
|
||||
[ generate-help ] benchmark-ms html-help-time-file to-file
|
||||
[ do-tests ] benchmark-ms test-time-file to-file
|
||||
[ do-help-lint ] benchmark-ms help-lint-time-file to-file
|
||||
[ do-benchmarks ] benchmark-ms benchmark-time-file to-file
|
||||
[ do-load ] benchmark load-time-file to-file
|
||||
[ generate-help ] benchmark html-help-time-file to-file
|
||||
[ do-tests ] benchmark test-time-file to-file
|
||||
[ do-help-lint ] benchmark help-lint-time-file to-file
|
||||
[ do-benchmarks ] benchmark benchmark-time-file to-file
|
||||
do-compile-errors
|
||||
] with-directory ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue