Add deployment descriptors for benchmarks, and add a bigger input file for knucleotide and regex-dna

db4
Slava Pestov 2010-05-29 04:12:49 -04:00
parent 8fd6a24edb
commit f790934768
13 changed files with 15131 additions and 32 deletions

View File

@ -1,5 +1,7 @@
USING: kernel math accessors prettyprint io locals sequences ! Copyright (C) 2008, 2010 Slava Pestov.
math.ranges math.order ; ! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel math math.ranges math.order math.parser
io locals sequences ;
IN: benchmark.binary-trees IN: benchmark.binary-trees
TUPLE: tree-node item left right ; TUPLE: tree-node item left right ;
@ -27,8 +29,8 @@ CONSTANT: min-depth 4
: stretch-tree ( max-depth -- ) : stretch-tree ( max-depth -- )
1 + 0 over bottom-up-tree item-check 1 + 0 over bottom-up-tree item-check
[ "stretch tree of depth " write pprint ] [ "stretch tree of depth " write number>string write ]
[ "\t check: " write . ] bi* ; inline [ "\t check: " write number>string print ] bi* ; inline
:: long-lived-tree ( max-depth -- ) :: long-lived-tree ( max-depth -- )
0 max-depth bottom-up-tree 0 max-depth bottom-up-tree
@ -40,13 +42,13 @@ CONSTANT: min-depth 4
[ depth bottom-up-tree item-check + ] bi@ [ depth bottom-up-tree item-check + ] bi@
] reduce ] reduce
] ]
[ 2 * ] bi [ 2 * number>string write ] bi
pprint "\t trees of depth " write depth pprint "\t trees of depth " write depth number>string write
"\t check: " write . "\t check: " write number>string print
] each ] each
"long lived tree of depth " write max-depth pprint "long lived tree of depth " write max-depth number>string write
"\t check: " write item-check . ; inline "\t check: " write item-check number>string print ; inline
: binary-trees ( n -- ) : binary-trees ( n -- )
min-depth 2 + max [ stretch-tree ] [ long-lived-tree ] bi ; inline min-depth 2 + max [ stretch-tree ] [ long-lived-tree ] bi ; inline

View File

@ -0,0 +1,15 @@
USING: tools.deploy.config ;
H{
{ deploy-ui? f }
{ deploy-word-defs? f }
{ deploy-threads? t }
{ deploy-math? t }
{ deploy-io 2 }
{ deploy-reflection 1 }
{ deploy-unicode? f }
{ "stop-after-last-window?" t }
{ deploy-console? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ deploy-name "benchmark.binary-trees" }
}

View File

@ -0,0 +1,15 @@
USING: tools.deploy.config ;
H{
{ deploy-name "benchmark.fasta" }
{ deploy-ui? f }
{ deploy-c-types? f }
{ deploy-console? t }
{ deploy-unicode? f }
{ "stop-after-last-window?" t }
{ deploy-io 3 }
{ deploy-reflection 1 }
{ deploy-word-props? f }
{ deploy-math? t }
{ deploy-threads? t }
{ deploy-word-defs? f }
}

View File

@ -0,0 +1,15 @@
USING: tools.deploy.config ;
H{
{ deploy-ui? f }
{ deploy-word-defs? f }
{ deploy-threads? t }
{ deploy-math? t }
{ deploy-io 2 }
{ deploy-reflection 1 }
{ deploy-unicode? f }
{ "stop-after-last-window?" t }
{ deploy-console? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ deploy-name "benchmark.knucleotide" }
}

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,13 @@
! Copyright (C) 2008, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: ascii kernel io io.files splitting strings USING: ascii kernel io io.files splitting strings
io.encodings.ascii hashtables sequences assocs math io.encodings.ascii hashtables sequences assocs math
math.statistics namespaces prettyprint math.parser combinators math.statistics namespaces math.parser combinators arrays
arrays sorting formatting grouping fry ; sorting formatting grouping fry ;
IN: benchmark.knucleotide IN: benchmark.knucleotide
CONSTANT: knucleotide-in "vocab:benchmark/knucleotide/knucleotide-input.txt"
: discard-lines ( -- ) : discard-lines ( -- )
readln readln
[ ">THREE" head? [ discard-lines ] unless ] when* ; [ ">THREE" head? [ discard-lines ] unless ] when* ;
@ -34,7 +38,7 @@ IN: benchmark.knucleotide
tri ; tri ;
: knucleotide ( -- ) : knucleotide ( -- )
"resource:extra/benchmark/knucleotide/knucleotide-input.txt" knucleotide-in
ascii [ read-input ] with-file-reader ascii [ read-input ] with-file-reader
process-input ; process-input ;

View File

@ -0,0 +1,15 @@
USING: tools.deploy.config ;
H{
{ deploy-ui? f }
{ deploy-word-defs? f }
{ deploy-threads? t }
{ deploy-math? t }
{ deploy-io 2 }
{ deploy-reflection 1 }
{ deploy-unicode? f }
{ "stop-after-last-window?" t }
{ deploy-console? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ deploy-name "benchmark.nbody-simd" }
}

View File

@ -1,9 +1,9 @@
! Copyright (C) 2008, 2009 Slava Pestov. ! Copyright (C) 2008, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types fry kernel locals math USING: accessors alien.c-types fry kernel locals math
math.constants math.functions math.vectors math.vectors.simd math.constants math.functions math.vectors math.vectors.simd
math.vectors.simd.cords prettyprint combinators.smart sequences math.vectors.simd.cords math.parser combinators.smart sequences
hints classes.struct specialized-arrays ; hints classes.struct specialized-arrays io ;
IN: benchmark.nbody-simd IN: benchmark.nbody-simd
: solar-mass ( -- x ) 4 pi sq * ; inline : solar-mass ( -- x ) 4 pi sq * ; inline
@ -94,7 +94,9 @@ SPECIALIZED-ARRAY: body
: nbody ( n -- ) : nbody ( n -- )
>fixnum >fixnum
<nbody-system> <nbody-system>
[ energy . ] [ '[ _ 0.01 advance ] times ] [ energy . ] tri ; [ energy number>string print ]
[ '[ _ 0.01 advance ] times ]
[ energy number>string print ] tri ;
: nbody-main ( -- ) 1000000 nbody ; : nbody-main ( -- ) 1000000 nbody ;

View File

@ -1,14 +1,15 @@
USING: tools.deploy.config ; USING: tools.deploy.config ;
H{ H{
{ deploy-word-defs? f }
{ deploy-word-props? f }
{ deploy-math? f }
{ deploy-ui? f } { deploy-ui? f }
{ deploy-c-types? f } { deploy-word-defs? f }
{ "stop-after-last-window?" t } { deploy-threads? t }
{ deploy-math? t }
{ deploy-io 3 }
{ deploy-reflection 1 } { deploy-reflection 1 }
{ deploy-name "benchmark.regex-dna" }
{ deploy-io 2 }
{ deploy-threads? f }
{ deploy-unicode? f } { deploy-unicode? f }
{ "stop-after-last-window?" t }
{ deploy-console? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ deploy-name "benchmark.regex-dna" }
} }

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008, 2009 Slava Pestov. ! Copyright (C) 2008, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors io io.encodings.ascii io.files kernel sequences USING: accessors io io.encodings.ascii io.files kernel sequences
assocs math.parser namespaces regexp ; assocs math.parser namespaces regexp benchmark.knucleotide ;
IN: benchmark.regex-dna IN: benchmark.regex-dna
! Based on http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=ruby&id=1 ! Based on http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=ruby&id=1
@ -55,6 +55,6 @@ SYMBOL: clen
length number>string print ; length number>string print ;
: regex-dna-main ( -- ) : regex-dna-main ( -- )
"resource:extra/benchmark/regex-dna/regex-dna-test-in.txt" regex-dna ; knucleotide-in regex-dna ;
MAIN: regex-dna-main MAIN: regex-dna-main

View File

@ -0,0 +1,15 @@
USING: tools.deploy.config ;
H{
{ deploy-ui? f }
{ deploy-word-defs? f }
{ deploy-threads? t }
{ deploy-math? t }
{ deploy-io 3 }
{ deploy-reflection 1 }
{ deploy-unicode? f }
{ "stop-after-last-window?" t }
{ deploy-console? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ deploy-name "benchmark.reverse-complement" }
}

View File

@ -0,0 +1,15 @@
USING: tools.deploy.config ;
H{
{ deploy-ui? f }
{ deploy-word-defs? f }
{ deploy-threads? t }
{ deploy-math? t }
{ deploy-io 2 }
{ deploy-reflection 1 }
{ deploy-unicode? f }
{ "stop-after-last-window?" t }
{ deploy-console? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ deploy-name "benchmark.spectral-norm" }
}

View File

@ -1,8 +1,8 @@
! Factor port of ! Factor port of
! http://shootout.alioth.debian.org/gp4/benchmark.php?test=spectralnorm&lang=all ! http://shootout.alioth.debian.org/gp4/benchmark.php?test=spectralnorm&lang=all
USING: alien.c-types specialized-arrays kernel math USING: alien.c-types io kernel math math.functions math.parser
math.functions math.vectors sequences sequences.private math.vectors sequences sequences.private specialized-arrays
prettyprint words typed locals ; typed locals ;
SPECIALIZED-ARRAY: double SPECIALIZED-ARRAY: double
IN: benchmark.spectral-norm IN: benchmark.spectral-norm
@ -47,6 +47,6 @@ TYPED: spectral-norm ( n: fixnum -- norm )
u/v [ v. ] [ norm-sq ] bi /f sqrt ; u/v [ v. ] [ norm-sq ] bi /f sqrt ;
: spectral-norm-main ( -- ) : spectral-norm-main ( -- )
2000 spectral-norm . ; 2000 spectral-norm number>string print ;
MAIN: spectral-norm-main MAIN: spectral-norm-main