From 38cb6947793d9ab6cfd55a2262aa4a8adefe7866 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Mon, 18 Feb 2008 17:16:37 -0600 Subject: [PATCH] builder: benchmark deltas --- extra/builder/builder.factor | 57 ++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/extra/builder/builder.factor b/extra/builder/builder.factor index 361401ad55..e01ac04eb2 100644 --- a/extra/builder/builder.factor +++ b/extra/builder/builder.factor @@ -62,8 +62,12 @@ VAR: stamp ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! : copy-image ( -- ) - "../../factor/" my-arch boot-image-name append - my-arch boot-image-name + "../../factor/" my-boot-image-name append + "../" my-boot-image-name append + copy-file + + "../../factor/" my-boot-image-name append + my-boot-image-name copy-file ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -76,8 +80,7 @@ VAR: stamp case ; : bootstrap-cmd ( -- cmd ) - { factor-binary [ "-i=" my-boot-image-name append ] "-no-user-init" } - to-strings ; + { factor-binary { "-i=" my-boot-image-name } "-no-user-init" } to-strings ; : bootstrap ( -- desc ) @@ -104,6 +107,37 @@ VAR: stamp ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +USING: arrays assocs math ; + +: passing-benchmarks ( table -- table ) + [ second first2 number? swap number? and ] subset ; + +: simplify-table ( table -- table ) [ first2 second 2array ] map ; + +: benchmark-difference ( old-table benchmark-result -- result-diff ) + first2 >r + tuck swap at + r> + swap - + 2array ; + +: compare-tables ( old new -- table ) + [ passing-benchmarks simplify-table ] 2apply + [ benchmark-difference ] with map ; + +: show-benchmark-deltas ( -- ) + "Benchmark deltas: " print + + [ + "../../benchmarks" eval-file + "../benchmarks" eval-file + compare-tables . + ] + [ drop "Error generating benchmark deltas" . ] + recover ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + SYMBOL: build-status : (build) ( -- ) @@ -143,6 +177,8 @@ SYMBOL: build-status builder-test [ "Test error" print "../test-log" cat ] run-or-bail + + "Boot time: " write "../boot-time" eval-file milli-seconds>time print "Load time: " write "../load-time" eval-file milli-seconds>time print "Test time: " write "../test-time" eval-file milli-seconds>time print nl @@ -153,6 +189,12 @@ SYMBOL: build-status "Benchmarks: " print "../benchmarks" [ stdio get contents eval ] with-file-reader benchmarks. + nl + + show-benchmark-deltas + + "../benchmarks" "../../benchmarks" copy-file + ] with-file-writer build-status on ; @@ -175,9 +217,12 @@ SYMBOL: builder-recipients "../report" file>string >>body send ; +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + : build ( -- ) [ (build) ] [ drop ] recover - [ send-builder-email ] [ drop "not sending mail" . ] recover ; + [ send-builder-email ] [ drop "not sending mail" . ] recover + ".." cd { "rm" "-rf" "factor" } run-process drop ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -199,7 +244,7 @@ USE: bootstrap.image.download = not ; : new-image-available? ( -- ? ) - my-arch boot-image-name need-new-image? + my-boot-image-name need-new-image? [ download-my-image t ] [ f ] if ;