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
math.ranges math.order ;
! Copyright (C) 2008, 2010 Slava Pestov.
! 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
TUPLE: tree-node item left right ;
@ -27,8 +29,8 @@ CONSTANT: min-depth 4
: stretch-tree ( max-depth -- )
1 + 0 over bottom-up-tree item-check
[ "stretch tree of depth " write pprint ]
[ "\t check: " write . ] bi* ; inline
[ "stretch tree of depth " write number>string write ]
[ "\t check: " write number>string print ] bi* ; inline
:: long-lived-tree ( max-depth -- )
0 max-depth bottom-up-tree
@ -40,13 +42,13 @@ CONSTANT: min-depth 4
[ depth bottom-up-tree item-check + ] bi@
] reduce
]
[ 2 * ] bi
pprint "\t trees of depth " write depth pprint
"\t check: " write .
[ 2 * number>string write ] bi
"\t trees of depth " write depth number>string write
"\t check: " write number>string print
] each
"long lived tree of depth " write max-depth pprint
"\t check: " write item-check . ; inline
"long lived tree of depth " write max-depth number>string write
"\t check: " write item-check number>string print ; inline
: binary-trees ( n -- )
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
io.encodings.ascii hashtables sequences assocs math
math.statistics namespaces prettyprint math.parser combinators
arrays sorting formatting grouping fry ;
math.statistics namespaces math.parser combinators arrays
sorting formatting grouping fry ;
IN: benchmark.knucleotide
CONSTANT: knucleotide-in "vocab:benchmark/knucleotide/knucleotide-input.txt"
: discard-lines ( -- )
readln
[ ">THREE" head? [ discard-lines ] unless ] when* ;
@ -34,7 +38,7 @@ IN: benchmark.knucleotide
tri ;
: knucleotide ( -- )
"resource:extra/benchmark/knucleotide/knucleotide-input.txt"
knucleotide-in
ascii [ read-input ] with-file-reader
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.
USING: accessors alien.c-types fry kernel locals math
math.constants math.functions math.vectors math.vectors.simd
math.vectors.simd.cords prettyprint combinators.smart sequences
hints classes.struct specialized-arrays ;
math.vectors.simd.cords math.parser combinators.smart sequences
hints classes.struct specialized-arrays io ;
IN: benchmark.nbody-simd
: solar-mass ( -- x ) 4 pi sq * ; inline
@ -94,7 +94,9 @@ SPECIALIZED-ARRAY: body
: nbody ( n -- )
>fixnum
<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 ;

View File

@ -1,14 +1,15 @@
USING: tools.deploy.config ;
H{
{ deploy-word-defs? f }
{ deploy-word-props? f }
{ deploy-math? f }
{ deploy-ui? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ deploy-word-defs? f }
{ deploy-threads? t }
{ deploy-math? t }
{ deploy-io 3 }
{ deploy-reflection 1 }
{ deploy-name "benchmark.regex-dna" }
{ deploy-io 2 }
{ deploy-threads? 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.
! See http://factorcode.org/license.txt for BSD license.
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
! 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 ;
: regex-dna-main ( -- )
"resource:extra/benchmark/regex-dna/regex-dna-test-in.txt" regex-dna ;
knucleotide-in regex-dna ;
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
! http://shootout.alioth.debian.org/gp4/benchmark.php?test=spectralnorm&lang=all
USING: alien.c-types specialized-arrays kernel math
math.functions math.vectors sequences sequences.private
prettyprint words typed locals ;
USING: alien.c-types io kernel math math.functions math.parser
math.vectors sequences sequences.private specialized-arrays
typed locals ;
SPECIALIZED-ARRAY: double
IN: benchmark.spectral-norm
@ -47,6 +47,6 @@ TYPED: spectral-norm ( n: fixnum -- norm )
u/v [ v. ] [ norm-sq ] bi /f sqrt ;
: spectral-norm-main ( -- )
2000 spectral-norm . ;
2000 spectral-norm number>string print ;
MAIN: spectral-norm-main