factor: in: -> IN:
vocab-roots get [ vocabs-from reject-some-paths ] map concat { "specialized-arrays" "specialized-vectors" "math.blas.matrices" "math.blas.vectors" "math.vectors.simd" "math.vectors.simd.cords" "game.debug" "gpu.util" "gpu.effects.blur" "gpu.effects.step" "model-viewer" "terrain.shaders" "spheres" "bunny.cel-shaded" "bunny.outlined" } diff [ modern-source-path ] map [ dup { [ lowercase-colon-literal? ] [ tag>> "in" sequence= ] } 1&& [ [ drop "IN" ] change-tag ] when ] rewrite-pathslocals-and-roots
parent
9b79fc6788
commit
263b8b9507
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: combinators combinators.smart io kernel math math.parser
|
USING: combinators combinators.smart io kernel math math.parser
|
||||||
math.ranges sequences ascii ;
|
math.ranges sequences ascii ;
|
||||||
in: 99-bottles
|
IN: 99-bottles
|
||||||
|
|
||||||
: bottles ( n -- number string )
|
: bottles ( n -- number string )
|
||||||
[ dup 0 > [ number>string ] [ drop "No more" ] if ]
|
[ dup 0 > [ number>string ] [ drop "No more" ] if ]
|
||||||
|
|
|
@ -6,7 +6,7 @@ colors.constants colors.hex combinators concurrency.combinators
|
||||||
formatting fry hashtables http.client io io.styles json.reader
|
formatting fry hashtables http.client io io.styles json.reader
|
||||||
kernel make math math.parser sequences ui urls vocabs ;
|
kernel make math math.parser sequences ui urls vocabs ;
|
||||||
|
|
||||||
in: hacker-news
|
IN: hacker-news
|
||||||
|
|
||||||
PRIVATE<
|
PRIVATE<
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
USING: accessors timers bit-arrays calendar game.input io
|
USING: accessors timers bit-arrays calendar game.input io
|
||||||
io.binary io.encodings.binary io.files kernel literals math
|
io.binary io.encodings.binary io.files kernel literals math
|
||||||
namespaces system threads ;
|
namespaces system threads ;
|
||||||
in: key-logger
|
IN: key-logger
|
||||||
|
|
||||||
CONSTANT: frequency $[ 1/30 seconds ] ;
|
CONSTANT: frequency $[ 1/30 seconds ] ;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: kernel io io.files io.pathnames io.monitors io.encodings.utf8 ;
|
USING: kernel io io.files io.pathnames io.monitors io.encodings.utf8 ;
|
||||||
in: log-viewer
|
IN: log-viewer
|
||||||
|
|
||||||
: read-lines ( stream -- )
|
: read-lines ( stream -- )
|
||||||
dup stream-readln dup
|
dup stream-readln dup
|
||||||
|
|
|
@ -6,7 +6,7 @@ colors.constants colors.hex combinators formatting fry
|
||||||
http.client io io.styles json json.reader kernel make math
|
http.client io io.styles json json.reader kernel make math
|
||||||
math.statistics sequences urls ;
|
math.statistics sequences urls ;
|
||||||
|
|
||||||
in: reddit
|
IN: reddit
|
||||||
|
|
||||||
PRIVATE<
|
PRIVATE<
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
USING: arrays io.launcher kernel present system webbrowser ;
|
USING: arrays io.launcher kernel present system webbrowser ;
|
||||||
|
|
||||||
in: webbrowser.linux
|
IN: webbrowser.linux
|
||||||
|
|
||||||
M: linux open-file ( path -- )
|
M: linux open-file ( path -- )
|
||||||
present "xdg-open" swap 2array run-detached drop ;
|
present "xdg-open" swap 2array run-detached drop ;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
USING: arrays io.launcher kernel present system webbrowser ;
|
USING: arrays io.launcher kernel present system webbrowser ;
|
||||||
|
|
||||||
in: webbrowser.macosx
|
IN: webbrowser.macosx
|
||||||
|
|
||||||
M: macosx open-file ( path -- )
|
M: macosx open-file ( path -- )
|
||||||
present "open" swap 2array run-detached drop ;
|
present "open" swap 2array run-detached drop ;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
USING: accessors combinators.short-circuit io.pathnames
|
USING: accessors combinators.short-circuit io.pathnames
|
||||||
sequences strings system ui.operations urls vocabs ;
|
sequences strings system ui.operations urls vocabs ;
|
||||||
|
|
||||||
in: webbrowser
|
IN: webbrowser
|
||||||
|
|
||||||
HOOK: open-file os ( path -- ) ;
|
HOOK: open-file os ( path -- ) ;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
USING: kernel present system webbrowser windows.shell32
|
USING: kernel present system webbrowser windows.shell32
|
||||||
windows.user32 ;
|
windows.user32 ;
|
||||||
|
|
||||||
in: webbrowser.windows
|
IN: webbrowser.windows
|
||||||
|
|
||||||
M: windows open-file ( path -- )
|
M: windows open-file ( path -- )
|
||||||
[ f "open" ] dip present f f
|
[ f "open" ] dip present f f
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: kernel locals math math.matrices math.order math.vectors
|
USING: kernel locals math math.matrices math.order math.vectors
|
||||||
prettyprint sequences ;
|
prettyprint sequences ;
|
||||||
in: benchmark.3d-matrix-scalar
|
IN: benchmark.3d-matrix-scalar
|
||||||
|
|
||||||
:: p-matrix ( dim fov near far -- matrix )
|
:: p-matrix ( dim fov near far -- matrix )
|
||||||
dim dup first2 min v/n fov v*n near v*n
|
dim dup first2 min v/n fov v*n near v*n
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
USING: kernel locals math math.matrices.simd math.order math.vectors
|
USING: kernel locals math math.matrices.simd math.order math.vectors
|
||||||
math.vectors.simd prettyprint sequences typed ;
|
math.vectors.simd prettyprint sequences typed ;
|
||||||
QUALIFIED-WITH: alien.c-types c ;
|
QUALIFIED-WITH: alien.c-types c ;
|
||||||
in: benchmark.3d-matrix-vector
|
IN: benchmark.3d-matrix-vector
|
||||||
|
|
||||||
: v2min ( xy -- xx )
|
: v2min ( xy -- xx )
|
||||||
dup { 1 0 2 3 } vshuffle vmin ; inline
|
dup { 1 0 2 3 } vshuffle vmin ; inline
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
USING: accessors combinators fry hash-sets hashtables kernel
|
USING: accessors combinators fry hash-sets hashtables kernel
|
||||||
locals math math.parser sequences sets vectors ;
|
locals math math.parser sequences sets vectors ;
|
||||||
|
|
||||||
in: benchmark.ant
|
IN: benchmark.ant
|
||||||
|
|
||||||
! There is an ant which can walk around on a planar grid. The ant
|
! There is an ant which can walk around on a planar grid. The ant
|
||||||
! can move one space at a time left, right, up or down. That is,
|
! can move one space at a time left, right, up or down. That is,
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
USING: backtrack shuffle math math.ranges quotations locals fry
|
USING: backtrack shuffle math math.ranges quotations locals fry
|
||||||
kernel words io memoize macros prettyprint sequences assocs
|
kernel words io memoize macros prettyprint sequences assocs
|
||||||
combinators namespaces ;
|
combinators namespaces ;
|
||||||
in: benchmark.backtrack
|
IN: benchmark.backtrack
|
||||||
|
|
||||||
! This was suggested by Dr_Ford. Compute the number of quadruples
|
! This was suggested by Dr_Ford. Compute the number of quadruples
|
||||||
! (a,b,c,d) with 1 <= a,b,c,d <= 10 such that we can make 24 by
|
! (a,b,c,d) with 1 <= a,b,c,d <= 10 such that we can make 24 by
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: math sequences kernel base64 ;
|
USING: math sequences kernel base64 ;
|
||||||
in: benchmark.base64
|
IN: benchmark.base64
|
||||||
|
|
||||||
: base64-benchmark ( -- )
|
: base64-benchmark ( -- )
|
||||||
65535 iota [ 255 bitand ] "" map-as
|
65535 iota [ 255 bitand ] "" map-as
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
USING: arrays assocs continuations debugger formatting fry help.markup
|
USING: arrays assocs continuations debugger formatting fry help.markup
|
||||||
io io.styles kernel math memory prettyprint sequences
|
io io.styles kernel math memory prettyprint sequences
|
||||||
tools.profiler.sampling tools.test tools.time vocabs.hierarchy vocabs.loader ;
|
tools.profiler.sampling tools.test tools.time vocabs.hierarchy vocabs.loader ;
|
||||||
in: benchmark
|
IN: benchmark
|
||||||
|
|
||||||
: run-timing-benchmark ( vocab -- time )
|
: run-timing-benchmark ( vocab -- time )
|
||||||
5 swap '[ gc [ _ run ] benchmark ] replicate infimum ;
|
5 swap '[ gc [ _ run ] benchmark ] replicate infimum ;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel math.ranges math.parser sets sequences ;
|
USING: kernel math.ranges math.parser sets sequences ;
|
||||||
in: benchmark.beust1
|
IN: benchmark.beust1
|
||||||
|
|
||||||
: count-numbers ( max -- n )
|
: count-numbers ( max -- n )
|
||||||
1 [a,b] [ number>string all-unique? ] count ; inline
|
1 [a,b] [ number>string all-unique? ] count ; inline
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel locals math math.ranges math.parser sequences ;
|
USING: kernel locals math math.ranges math.parser sequences ;
|
||||||
in: benchmark.beust2
|
IN: benchmark.beust2
|
||||||
|
|
||||||
! http://crazybob.org/BeustSequence.java.html
|
! http://crazybob.org/BeustSequence.java.html
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: binary-search kernel math.primes math.ranges memoize
|
USING: binary-search kernel math.primes math.ranges memoize
|
||||||
prettyprint sequences ;
|
prettyprint sequences ;
|
||||||
in: benchmark.binary-search
|
IN: benchmark.binary-search
|
||||||
|
|
||||||
MEMO: primes-under-million ( -- seq ) 1000000 primes-upto ;
|
MEMO: primes-under-million ( -- seq ) 1000000 primes-upto ;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors kernel math math.ranges math.order math.parser
|
USING: accessors kernel math math.ranges math.order math.parser
|
||||||
io locals sequences ;
|
io locals sequences ;
|
||||||
in: benchmark.binary-trees
|
IN: benchmark.binary-trees
|
||||||
|
|
||||||
TUPLE: tree-node item left right ;
|
TUPLE: tree-node item left right ;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: bloom-filters kernel math sequences ;
|
USING: bloom-filters kernel math sequences ;
|
||||||
|
|
||||||
in: benchmark.bloom-filters
|
IN: benchmark.bloom-filters
|
||||||
|
|
||||||
: insert-data ( bloom-filter -- bloom-filter )
|
: insert-data ( bloom-filter -- bloom-filter )
|
||||||
100 [ 2,000 iota [ over bloom-filter-insert ] each ] times ;
|
100 [ 2,000 iota [ over bloom-filter-insert ] each ] times ;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
USING: bootstrap.image ;
|
USING: bootstrap.image ;
|
||||||
in: benchmark.bootstrap1
|
IN: benchmark.bootstrap1
|
||||||
|
|
||||||
main: make-images
|
main: make-images
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: kernel math ;
|
USING: kernel math ;
|
||||||
|
|
||||||
in: benchmark.busy-loop
|
IN: benchmark.busy-loop
|
||||||
|
|
||||||
: busy-loop ( x -- n )
|
: busy-loop ( x -- n )
|
||||||
1,000 [
|
1,000 [
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
USING: accessors arrays assocs combinators
|
USING: accessors arrays assocs combinators
|
||||||
concurrency.mailboxes fry io kernel make math math.parser
|
concurrency.mailboxes fry io kernel make math math.parser
|
||||||
math.text.english sequences threads ;
|
math.text.english sequences threads ;
|
||||||
in: benchmark.chameneos-redux
|
IN: benchmark.chameneos-redux
|
||||||
|
|
||||||
SYMBOLS: red yellow blue ;
|
SYMBOLS: red yellow blue ;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
USING: combinators kernel math math.combinatorics math.ranges
|
USING: combinators kernel math math.combinatorics math.ranges
|
||||||
sequences ;
|
sequences ;
|
||||||
|
|
||||||
in: benchmark.combinatorics
|
IN: benchmark.combinatorics
|
||||||
|
|
||||||
: bench-combinations ( n -- )
|
: bench-combinations ( n -- )
|
||||||
[1,b] dup clone [
|
[1,b] dup clone [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
USING: kernel sequences tools.completion ;
|
USING: kernel sequences tools.completion ;
|
||||||
|
|
||||||
in: benchmark.completion
|
IN: benchmark.completion
|
||||||
|
|
||||||
: completion-benchmark ( -- )
|
: completion-benchmark ( -- )
|
||||||
"nth" 25,000 [
|
"nth" 25,000 [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: math kernel continuations ;
|
USING: math kernel continuations ;
|
||||||
in: benchmark.continuations
|
IN: benchmark.continuations
|
||||||
|
|
||||||
: continuations-benchmark ( -- )
|
: continuations-benchmark ( -- )
|
||||||
1,000,000 [ drop [ continue ] callcc0 ] each-integer ;
|
1,000,000 [ drop [ continue ] callcc0 ] each-integer ;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: checksums checksums.crc32 io.encodings.ascii io.files kernel math ;
|
USING: checksums checksums.crc32 io.encodings.ascii io.files kernel math ;
|
||||||
in: benchmark.crc32
|
IN: benchmark.crc32
|
||||||
|
|
||||||
: crc32-benchmark ( -- )
|
: crc32-benchmark ( -- )
|
||||||
1,000 [
|
1,000 [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2012 John Benediktsson
|
! Copyright (C) 2012 John Benediktsson
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: arrays csv kernel math.parser sequences ;
|
USING: arrays csv kernel math.parser sequences ;
|
||||||
in: benchmark.csv
|
IN: benchmark.csv
|
||||||
|
|
||||||
: csv-benchmark ( -- )
|
: csv-benchmark ( -- )
|
||||||
1,000 200 iota [ number>string ] map <array>
|
1,000 200 iota [ number>string ] map <array>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
USING: alien.c-types sequences kernel math specialized-arrays
|
USING: alien.c-types sequences kernel math specialized-arrays
|
||||||
fry ;
|
fry ;
|
||||||
specialized-array: int
|
specialized-array: int
|
||||||
in: benchmark.dawes
|
IN: benchmark.dawes
|
||||||
|
|
||||||
! Phil Dawes's performance problem
|
! Phil Dawes's performance problem
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: classes classes.tuple kernel sequences vocabs math ;
|
USING: classes classes.tuple kernel sequences vocabs math ;
|
||||||
in: benchmark.dispatch1
|
IN: benchmark.dispatch1
|
||||||
|
|
||||||
GENERIC: g ( obj -- obj ) ;
|
GENERIC: g ( obj -- obj ) ;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
USING: alien.c-types make math sequences splitting grouping
|
USING: alien.c-types make math sequences splitting grouping
|
||||||
kernel columns specialized-arrays bit-arrays ;
|
kernel columns specialized-arrays bit-arrays ;
|
||||||
specialized-array: double
|
specialized-array: double
|
||||||
in: benchmark.dispatch2
|
IN: benchmark.dispatch2
|
||||||
|
|
||||||
: sequences ( -- seq )
|
: sequences ( -- seq )
|
||||||
[
|
[
|
||||||
|
|
|
@ -2,7 +2,7 @@ USING: alien.c-types sequences math mirrors splitting grouping
|
||||||
kernel make assocs alien.syntax columns
|
kernel make assocs alien.syntax columns
|
||||||
specialized-arrays bit-arrays ;
|
specialized-arrays bit-arrays ;
|
||||||
specialized-array: double
|
specialized-array: double
|
||||||
in: benchmark.dispatch3
|
IN: benchmark.dispatch3
|
||||||
|
|
||||||
GENERIC: g ( obj -- str ) ;
|
GENERIC: g ( obj -- str ) ;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: kernel.private kernel sequences math combinators
|
USING: kernel.private kernel sequences math combinators
|
||||||
sequences.private ;
|
sequences.private ;
|
||||||
in: benchmark.dispatch4
|
IN: benchmark.dispatch4
|
||||||
|
|
||||||
: dispatch4 ( n -- val )
|
: dispatch4 ( n -- val )
|
||||||
dup {
|
dup {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: classes classes.tuple kernel sequences vocabs math ;
|
USING: classes classes.tuple kernel sequences vocabs math ;
|
||||||
in: benchmark.dispatch5
|
IN: benchmark.dispatch5
|
||||||
|
|
||||||
mixin: g
|
mixin: g
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: kernel.private kernel sequences math combinators
|
USING: kernel.private kernel sequences math combinators
|
||||||
sequences.private ;
|
sequences.private ;
|
||||||
in: benchmark.dispatch6
|
IN: benchmark.dispatch6
|
||||||
|
|
||||||
: dispatch6 ( n -- val )
|
: dispatch6 ( n -- val )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2012 John Benediktsson
|
! Copyright (C) 2012 John Benediktsson
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: deques dlists kernel math sequences ;
|
USING: deques dlists kernel math sequences ;
|
||||||
in: benchmark.dlists
|
IN: benchmark.dlists
|
||||||
|
|
||||||
: dlists-benchmark ( -- )
|
: dlists-benchmark ( -- )
|
||||||
5,000 iota [
|
5,000 iota [
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: decimals kernel locals math math.combinatorics math.ranges
|
USING: decimals kernel locals math math.combinatorics math.ranges
|
||||||
sequences ;
|
sequences ;
|
||||||
in: benchmark.e-decimals
|
IN: benchmark.e-decimals
|
||||||
|
|
||||||
: D-factorial ( n -- D! )
|
: D-factorial ( n -- D! )
|
||||||
iota decimal: 1 [ 0 <decimal> decimal: 1 D+ D* ] reduce ; inline
|
iota decimal: 1 [ 0 <decimal> decimal: 1 D+ D* ] reduce ; inline
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2009 Doug Coleman.
|
! Copyright (C) 2009 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel math math.combinatorics math.ranges sequences ;
|
USING: kernel math math.combinatorics math.ranges sequences ;
|
||||||
in: benchmark.e-ratios
|
IN: benchmark.e-ratios
|
||||||
|
|
||||||
: calculate-e-ratios ( n -- e )
|
: calculate-e-ratios ( n -- e )
|
||||||
iota [ factorial recip ] map-sum ;
|
iota [ factorial recip ] map-sum ;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: math math.private kernel sequences ;
|
USING: math math.private kernel sequences ;
|
||||||
in: benchmark.empty-loop-0
|
IN: benchmark.empty-loop-0
|
||||||
|
|
||||||
: empty-loop-0 ( n -- )
|
: empty-loop-0 ( n -- )
|
||||||
dup 0 fixnum< [ drop ] [ 1 fixnum-fast empty-loop-0 ] if ;
|
dup 0 fixnum< [ drop ] [ 1 fixnum-fast empty-loop-0 ] if ;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: math math.private kernel sequences ;
|
USING: math math.private kernel sequences ;
|
||||||
in: benchmark.empty-loop-1
|
IN: benchmark.empty-loop-1
|
||||||
|
|
||||||
: empty-loop-1 ( n -- )
|
: empty-loop-1 ( n -- )
|
||||||
[ drop ] each-integer ;
|
[ drop ] each-integer ;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: math math.private kernel sequences ;
|
USING: math math.private kernel sequences ;
|
||||||
in: benchmark.empty-loop-2
|
IN: benchmark.empty-loop-2
|
||||||
|
|
||||||
: empty-loop-2 ( n -- )
|
: empty-loop-2 ( n -- )
|
||||||
iota [ drop ] each ;
|
iota [ drop ] each ;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
in: benchmark.euler150
|
IN: benchmark.euler150
|
||||||
USING: kernel project-euler.150 ;
|
USING: kernel project-euler.150 ;
|
||||||
|
|
||||||
: euler150-benchmark ( -- )
|
: euler150-benchmark ( -- )
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel fry math math.combinatorics math.order sequences
|
USING: kernel fry math math.combinatorics math.order sequences
|
||||||
io prettyprint ;
|
io prettyprint ;
|
||||||
in: benchmark.fannkuch
|
IN: benchmark.fannkuch
|
||||||
|
|
||||||
: count ( quot: ( -- ? ) -- n )
|
: count ( quot: ( -- ? ) -- n )
|
||||||
! Call quot until it returns false, return number of times
|
! Call quot until it returns false, return number of times
|
||||||
|
|
|
@ -4,7 +4,7 @@ io.encodings.ascii io.files locals kernel math sequences
|
||||||
sequences.private specialized-arrays strings typed alien.data ;
|
sequences.private specialized-arrays strings typed alien.data ;
|
||||||
QUALIFIED-WITH: alien.c-types c ;
|
QUALIFIED-WITH: alien.c-types c ;
|
||||||
specialized-array: c:double
|
specialized-array: c:double
|
||||||
in: benchmark.fasta
|
IN: benchmark.fasta
|
||||||
|
|
||||||
CONSTANT: IM 139968 ;
|
CONSTANT: IM 139968 ;
|
||||||
CONSTANT: IA 3877 ;
|
CONSTANT: IA 3877 ;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: math.private kernel debugger ;
|
USING: math.private kernel debugger ;
|
||||||
in: benchmark.fib1
|
IN: benchmark.fib1
|
||||||
|
|
||||||
: fast-fixnum-fib ( m -- n )
|
: fast-fixnum-fib ( m -- n )
|
||||||
dup 1 fixnum<= [
|
dup 1 fixnum<= [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: math.private kernel debugger ;
|
USING: math.private kernel debugger ;
|
||||||
in: benchmark.fib2
|
IN: benchmark.fib2
|
||||||
|
|
||||||
: fixnum-fib ( m -- n )
|
: fixnum-fib ( m -- n )
|
||||||
dup 1 fixnum<= [
|
dup 1 fixnum<= [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: math kernel debugger ;
|
USING: math kernel debugger ;
|
||||||
in: benchmark.fib3
|
IN: benchmark.fib3
|
||||||
|
|
||||||
: fib ( m -- n )
|
: fib ( m -- n )
|
||||||
dup 1 <= [ drop 1 ] [ dup 1 - fib swap 2 - fib + ] if ;
|
dup 1 <= [ drop 1 ] [ dup 1 - fib swap 2 - fib + ] if ;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: accessors math kernel debugger ;
|
USING: accessors math kernel debugger ;
|
||||||
in: benchmark.fib4
|
IN: benchmark.fib4
|
||||||
|
|
||||||
TUPLE: box { i read-only } ;
|
TUPLE: box { i read-only } ;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: math kernel debugger namespaces ;
|
USING: math kernel debugger namespaces ;
|
||||||
in: benchmark.fib5
|
IN: benchmark.fib5
|
||||||
|
|
||||||
symbol: n
|
symbol: n
|
||||||
: namespace-fib ( m -- n )
|
: namespace-fib ( m -- n )
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: math kernel alien alien.c-types ;
|
USING: math kernel alien alien.c-types ;
|
||||||
in: benchmark.fib6
|
IN: benchmark.fib6
|
||||||
|
|
||||||
: fib ( x -- y )
|
: fib ( x -- y )
|
||||||
int { int } cdecl [
|
int { int } cdecl [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: kernel locals math math.parser sequences ;
|
USING: kernel locals math math.parser sequences ;
|
||||||
in: benchmark.fib7
|
IN: benchmark.fib7
|
||||||
|
|
||||||
:: matrix-fib ( m -- n )
|
:: matrix-fib ( m -- n )
|
||||||
m 0 >= [ m throw ] unless
|
m 0 >= [ m throw ] unless
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: combinators kernel math memoize ;
|
USING: combinators kernel math memoize ;
|
||||||
in: benchmark.fib8
|
IN: benchmark.fib8
|
||||||
|
|
||||||
MEMO: (faster-fib) ( m -- n )
|
MEMO: (faster-fib) ( m -- n )
|
||||||
dup 1 > [
|
dup 1 > [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2012 John Benediktsson
|
! Copyright (C) 2012 John Benediktsson
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel locals math ;
|
USING: kernel locals math ;
|
||||||
in: benchmark.find-pi
|
IN: benchmark.find-pi
|
||||||
|
|
||||||
:: find-pi-to ( accuracy -- n approx )
|
:: find-pi-to ( accuracy -- n approx )
|
||||||
1 4 [
|
1 4 [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2012 John Benediktsson
|
! Copyright (C) 2012 John Benediktsson
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel math sequences ;
|
USING: kernel math sequences ;
|
||||||
in: benchmark.flip
|
IN: benchmark.flip
|
||||||
|
|
||||||
CONSTANT: my-generic { { 1 2 3 } V{ 4 5 6 } "ABC" } ;
|
CONSTANT: my-generic { { 1 2 3 } V{ 4 5 6 } "ABC" } ;
|
||||||
CONSTANT: my-array { { 1 2 3 } { 4 5 6 } { 7 8 9 } } ;
|
CONSTANT: my-array { { 1 2 3 } { 4 5 6 } { 7 8 9 } } ;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: arrays kernel math ;
|
USING: arrays kernel math ;
|
||||||
in: benchmark.gc0
|
IN: benchmark.gc0
|
||||||
|
|
||||||
: allocate ( -- obj ) 10 f <array> ;
|
: allocate ( -- obj ) 10 f <array> ;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: math sequences kernel ;
|
USING: math sequences kernel ;
|
||||||
in: benchmark.gc1
|
IN: benchmark.gc1
|
||||||
|
|
||||||
: gc1-benchmark ( -- ) 600000 iota [ >bignum 1 + ] map drop ;
|
: gc1-benchmark ( -- ) 600000 iota [ >bignum 1 + ] map drop ;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: arrays byte-arrays kernel namespaces sequences math memory ;
|
USING: arrays byte-arrays kernel namespaces sequences math memory ;
|
||||||
in: benchmark.gc2
|
IN: benchmark.gc2
|
||||||
|
|
||||||
! Runs slowly if clean cards are not unmarked.
|
! Runs slowly if clean cards are not unmarked.
|
||||||
symbol: oldies
|
symbol: oldies
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: math.parser fry sequences kernel assocs hashtables ;
|
USING: math.parser fry sequences kernel assocs hashtables ;
|
||||||
in: benchmark.gc3
|
IN: benchmark.gc3
|
||||||
|
|
||||||
: gc3-benchmark ( -- )
|
: gc3-benchmark ( -- )
|
||||||
1000000 iota
|
1000000 iota
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
USING: combinators fry hash-sets kernel literals
|
USING: combinators fry hash-sets kernel literals
|
||||||
math math.combinatorics sequences sets ;
|
math math.combinatorics sequences sets ;
|
||||||
|
|
||||||
in: benchmark.hash-sets
|
IN: benchmark.hash-sets
|
||||||
|
|
||||||
CONSTANT: test-sets $[
|
CONSTANT: test-sets $[
|
||||||
{ 10 100 1,000 10,000 50,000 100,000 }
|
{ 10 100 1,000 10,000 50,000 100,000 }
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors assocs combinators grouping kernel locals math
|
USING: accessors assocs combinators grouping kernel locals math
|
||||||
math.parser math.ranges memoize sequences ;
|
math.parser math.ranges memoize sequences ;
|
||||||
in: benchmark.hashtables
|
IN: benchmark.hashtables
|
||||||
|
|
||||||
MEMO: strings ( -- str )
|
MEMO: strings ( -- str )
|
||||||
0 100 [a,b) 1 [ + ] accumulate* [ number>string ] map ;
|
0 100 [a,b) 1 [ + ] accumulate* [ number>string ] map ;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: heaps math sequences kernel ;
|
USING: heaps math sequences kernel ;
|
||||||
in: benchmark.heaps
|
IN: benchmark.heaps
|
||||||
|
|
||||||
: data ( -- seq )
|
: data ( -- seq )
|
||||||
1 6000 [ 13 + 79 * 13591 mod dup ] replicate nip ;
|
1 6000 [ 13 + 79 * 13591 mod dup ] replicate nip ;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
USING: fry grouping interval-sets kernel math random sequences
|
USING: fry grouping interval-sets kernel math random sequences
|
||||||
sorting ;
|
sorting ;
|
||||||
|
|
||||||
in: benchmark.interval-sets
|
IN: benchmark.interval-sets
|
||||||
|
|
||||||
: interval-sets-benchmark ( -- )
|
: interval-sets-benchmark ( -- )
|
||||||
10,000 [ random-32 ] replicate natural-sort
|
10,000 [ random-32 ] replicate natural-sort
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
in: benchmark.iteration
|
IN: benchmark.iteration
|
||||||
USING: sequences vectors arrays strings sbufs math math.vectors
|
USING: sequences vectors arrays strings sbufs math math.vectors
|
||||||
kernel ;
|
kernel ;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: io.encodings.utf8 io.files kernel peg.javascript ;
|
USING: io.encodings.utf8 io.files kernel peg.javascript ;
|
||||||
in: benchmark.javascript
|
IN: benchmark.javascript
|
||||||
|
|
||||||
: javascript-benchmark ( -- )
|
: javascript-benchmark ( -- )
|
||||||
"vocab:benchmark/javascript/jquery-1.3.2.min.js"
|
"vocab:benchmark/javascript/jquery-1.3.2.min.js"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: assocs json.reader json.writer kernel math math.parser
|
USING: assocs json.reader json.writer kernel math math.parser
|
||||||
sequences ;
|
sequences ;
|
||||||
in: benchmark.json
|
IN: benchmark.json
|
||||||
|
|
||||||
: json-benchmark ( -- )
|
: json-benchmark ( -- )
|
||||||
200 iota [ [ number>string ] keep ] H{ } map>assoc
|
200 iota [ [ number>string ] keep ] H{ } map>assoc
|
||||||
|
|
|
@ -4,7 +4,7 @@ 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 math.parser combinators arrays
|
math.statistics namespaces math.parser combinators arrays
|
||||||
sorting formatting grouping fry ;
|
sorting formatting grouping fry ;
|
||||||
in: benchmark.knucleotide
|
IN: benchmark.knucleotide
|
||||||
|
|
||||||
CONSTANT: knucleotide-in "vocab:benchmark/knucleotide/knucleotide-input.txt" ;
|
CONSTANT: knucleotide-in "vocab:benchmark/knucleotide/knucleotide-input.txt" ;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: kernel lcs math ;
|
USING: kernel lcs math ;
|
||||||
in: benchmark.lcs
|
IN: benchmark.lcs
|
||||||
|
|
||||||
: lcs-benchmark ( -- )
|
: lcs-benchmark ( -- )
|
||||||
f 50,000 [ drop "sitting" "kitten" levenshtein ] times 3 assert=
|
f 50,000 [ drop "sitting" "kitten" levenshtein ] times 3 assert=
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
USING: io.encodings.ascii io.files kernel lexer math ;
|
USING: io.encodings.ascii io.files kernel lexer math ;
|
||||||
|
|
||||||
in: benchmark.lexer
|
IN: benchmark.lexer
|
||||||
|
|
||||||
: lexer-benchmark ( -- )
|
: lexer-benchmark ( -- )
|
||||||
10,000 "vocab:math/math.factor" ascii file-lines [
|
10,000 "vocab:math/math.factor" ascii file-lines [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
USING: assocs combinators fry kernel linked-assocs math
|
USING: assocs combinators fry kernel linked-assocs math
|
||||||
sequences ;
|
sequences ;
|
||||||
|
|
||||||
in: benchmark.linked-assocs
|
IN: benchmark.linked-assocs
|
||||||
|
|
||||||
: (linked-assocs-benchmark) ( -- )
|
: (linked-assocs-benchmark) ( -- )
|
||||||
10,000 iota <linked-hash> {
|
10,000 iota <linked-hash> {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
USING: kernel make math sequences ;
|
USING: kernel make math sequences ;
|
||||||
|
|
||||||
in: benchmark.make
|
IN: benchmark.make
|
||||||
|
|
||||||
: make-strings ( n -- seq )
|
: make-strings ( n -- seq )
|
||||||
[ [ char: a , ] times ] "" make ;
|
[ [ char: a , ] times ] "" make ;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: math math.order kernel arrays byte-arrays sequences
|
USING: math math.order kernel arrays byte-arrays sequences
|
||||||
colors.hsv accessors colors fry benchmark.mandel.params ;
|
colors.hsv accessors colors fry benchmark.mandel.params ;
|
||||||
in: benchmark.mandel.colors
|
IN: benchmark.mandel.colors
|
||||||
|
|
||||||
: scale ( x -- y ) 255 * >fixnum ; inline
|
: scale ( x -- y ) 255 * >fixnum ; inline
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ USING: io kernel math math.functions sequences prettyprint
|
||||||
io.files io.files.temp io.encodings io.encodings.ascii
|
io.files io.files.temp io.encodings io.encodings.ascii
|
||||||
io.encodings.binary fry benchmark.mandel.params
|
io.encodings.binary fry benchmark.mandel.params
|
||||||
benchmark.mandel.colors ;
|
benchmark.mandel.colors ;
|
||||||
in: benchmark.mandel
|
IN: benchmark.mandel
|
||||||
|
|
||||||
: x-scale ( -- x ) width 200000 zoom-fact * / ; inline
|
: x-scale ( -- x ) width 200000 zoom-fact * / ; inline
|
||||||
: y-scale ( -- y ) height 150000 zoom-fact * / ; inline
|
: y-scale ( -- y ) height 150000 zoom-fact * / ; inline
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
in: benchmark.mandel.params
|
IN: benchmark.mandel.params
|
||||||
|
|
||||||
CONSTANT: max-color 360 ;
|
CONSTANT: max-color 360 ;
|
||||||
CONSTANT: zoom-fact 0.8 ;
|
CONSTANT: zoom-fact 0.8 ;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: locals math math.combinatorics math.matrices
|
USING: locals math math.combinatorics math.matrices
|
||||||
prettyprint sequences typed ;
|
prettyprint sequences typed ;
|
||||||
in: benchmark.matrix-exponential-scalar
|
IN: benchmark.matrix-exponential-scalar
|
||||||
|
|
||||||
:: e^m ( m iterations -- e^m )
|
:: e^m ( m iterations -- e^m )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: locals math math.combinatorics math.matrices.simd
|
USING: locals math math.combinatorics math.matrices.simd
|
||||||
prettyprint sequences typed ;
|
prettyprint sequences typed ;
|
||||||
in: benchmark.matrix-exponential-simd
|
IN: benchmark.matrix-exponential-simd
|
||||||
|
|
||||||
TYPED:: e^m4 ( m: matrix4 iterations: fixnum -- e^m: matrix4 )
|
TYPED:: e^m4 ( m: matrix4 iterations: fixnum -- e^m: matrix4 )
|
||||||
zero-matrix4
|
zero-matrix4
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: checksums checksums.md5 sequences byte-arrays kernel ;
|
USING: checksums checksums.md5 sequences byte-arrays kernel ;
|
||||||
in: benchmark.md5
|
IN: benchmark.md5
|
||||||
|
|
||||||
: md5-benchmark ( -- )
|
: md5-benchmark ( -- )
|
||||||
2000000 iota >byte-array md5 checksum-bytes drop ;
|
2000000 iota >byte-array md5 checksum-bytes drop ;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2012 John Benediktsson
|
! Copyright (C) 2012 John Benediktsson
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel math memoize sequences ;
|
USING: kernel math memoize sequences ;
|
||||||
in: benchmark.memoize
|
IN: benchmark.memoize
|
||||||
|
|
||||||
MEMO: mem0 ( -- ) ;
|
MEMO: mem0 ( -- ) ;
|
||||||
MEMO: mem1 ( n -- n ) 1 + ;
|
MEMO: mem1 ( n -- n ) 1 + ;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: kernel math math.constants msgpack sequences ;
|
USING: kernel math math.constants msgpack sequences ;
|
||||||
in: benchmark.msgpack
|
IN: benchmark.msgpack
|
||||||
|
|
||||||
: pack-sum ( seq -- n )
|
: pack-sum ( seq -- n )
|
||||||
[ >msgpack msgpack> ] map-sum ;
|
[ >msgpack msgpack> ] map-sum ;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2009 Doug Coleman.
|
! Copyright (C) 2009 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: fry kernel math random random.mersenne-twister ;
|
USING: fry kernel math random random.mersenne-twister ;
|
||||||
in: benchmark.mt
|
IN: benchmark.mt
|
||||||
|
|
||||||
: mt-bench ( n -- )
|
: mt-bench ( n -- )
|
||||||
>fixnum 0x533d <mersenne-twister> '[ _ random-32* drop ] times ;
|
>fixnum 0x533d <mersenne-twister> '[ _ random-32* drop ] times ;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
USING: kernel math namespaces ;
|
USING: kernel math namespaces ;
|
||||||
|
|
||||||
in: benchmark.namespaces
|
IN: benchmark.namespaces
|
||||||
|
|
||||||
symbol: foo
|
symbol: foo
|
||||||
symbol: bar
|
symbol: bar
|
||||||
|
|
|
@ -4,7 +4,7 @@ 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 math.parser combinators.smart sequences
|
math.vectors.simd.cords math.parser combinators.smart sequences
|
||||||
hints classes.struct specialized-arrays io ;
|
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
|
||||||
CONSTANT: days-per-year 365.24 ;
|
CONSTANT: days-per-year 365.24 ;
|
||||||
|
|
|
@ -5,7 +5,7 @@ locals math math.constants math.functions math.vectors
|
||||||
prettyprint combinators.smart sequences hints arrays ;
|
prettyprint combinators.smart sequences hints arrays ;
|
||||||
FROM: alien.c-types => double ;
|
FROM: alien.c-types => double ;
|
||||||
specialized-array: double
|
specialized-array: double
|
||||||
in: benchmark.nbody
|
IN: benchmark.nbody
|
||||||
|
|
||||||
: solar-mass ( -- x ) 4 pi sq * ; inline
|
: solar-mass ( -- x ) 4 pi sq * ; inline
|
||||||
CONSTANT: days-per-year 365.24 ;
|
CONSTANT: days-per-year 365.24 ;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: math locals hints ;
|
USING: math locals hints ;
|
||||||
in: benchmark.nested-empty-loop-1
|
IN: benchmark.nested-empty-loop-1
|
||||||
|
|
||||||
:: nested-empty-loop ( n -- )
|
:: nested-empty-loop ( n -- )
|
||||||
n [
|
n [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel math math.ranges sequences locals hints ;
|
USING: kernel math math.ranges sequences locals hints ;
|
||||||
in: benchmark.nested-empty-loop-2
|
IN: benchmark.nested-empty-loop-2
|
||||||
|
|
||||||
: times ( seq quot -- ) [ drop ] prepose each ; inline
|
: times ( seq quot -- ) [ drop ] prepose each ; inline
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: math math.parser sequences sequences.private kernel
|
USING: math math.parser sequences sequences.private kernel
|
||||||
bit-arrays make io math.ranges multiline fry locals ;
|
bit-arrays make io math.ranges multiline fry locals ;
|
||||||
in: benchmark.nsieve-bits
|
IN: benchmark.nsieve-bits
|
||||||
|
|
||||||
: clear-flags ( step i seq -- )
|
: clear-flags ( step i seq -- )
|
||||||
2dup length >= [
|
2dup length >= [
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
in: benchmark.nsieve-bytes
|
IN: benchmark.nsieve-bytes
|
||||||
USING: math math.parser sequences sequences.private kernel
|
USING: math math.parser sequences sequences.private kernel
|
||||||
byte-arrays make io ;
|
byte-arrays make io ;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: math math.parser sequences sequences.private kernel
|
USING: math math.parser sequences sequences.private kernel
|
||||||
arrays make io ;
|
arrays make io ;
|
||||||
in: benchmark.nsieve
|
IN: benchmark.nsieve
|
||||||
|
|
||||||
: clear-flags ( step i seq -- )
|
: clear-flags ( step i seq -- )
|
||||||
2dup length >= [
|
2dup length >= [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: kernel math math.parser sequences ;
|
USING: kernel math math.parser sequences ;
|
||||||
in: benchmark.parse-bignum
|
IN: benchmark.parse-bignum
|
||||||
|
|
||||||
: parse-bignum-benchmark ( -- )
|
: parse-bignum-benchmark ( -- )
|
||||||
3000 iota [
|
3000 iota [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: kernel math.parser sequences ;
|
USING: kernel math.parser sequences ;
|
||||||
in: benchmark.parse-fixnum
|
IN: benchmark.parse-fixnum
|
||||||
|
|
||||||
: parse-fixnum-benchmark ( -- )
|
: parse-fixnum-benchmark ( -- )
|
||||||
2,000,000 iota [
|
2,000,000 iota [
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: kernel literals math.functions math.parser random
|
USING: kernel literals math.functions math.parser random
|
||||||
sequences ;
|
sequences ;
|
||||||
in: benchmark.parse-float
|
IN: benchmark.parse-float
|
||||||
|
|
||||||
CONSTANT: test-floats $[ 100,000 random-units ] ;
|
CONSTANT: test-floats $[ 100,000 random-units ] ;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: kernel literals math.parser math.vectors random
|
USING: kernel literals math.parser math.vectors random
|
||||||
sequences ;
|
sequences ;
|
||||||
in: benchmark.parse-ratio
|
IN: benchmark.parse-ratio
|
||||||
|
|
||||||
CONSTANT: test-ratios $[
|
CONSTANT: test-ratios $[
|
||||||
200,000 100,000 random-integers
|
200,000 100,000 random-integers
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: make math math.functions kernel io io.styles prettyprint
|
USING: make math math.functions kernel io io.styles prettyprint
|
||||||
combinators hints fry sequences ;
|
combinators hints fry sequences ;
|
||||||
in: benchmark.partial-sums
|
IN: benchmark.partial-sums
|
||||||
|
|
||||||
! Helper words
|
! Helper words
|
||||||
: summing-integers ( n quot -- y ) [ 0.0 ] [ iota ] [ ] tri* '[ 1 + @ + ] each ; inline
|
: summing-integers ( n quot -- y ) [ 0.0 ] [ iota ] [ ] tri* '[ 1 + @ + ] each ; inline
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
USING: arrays formatting fry grouping io kernel locals math
|
USING: arrays formatting fry grouping io kernel locals math
|
||||||
math.functions math.matrices math.parser math.primes.factors
|
math.functions math.matrices math.parser math.primes.factors
|
||||||
math.vectors prettyprint sequences sequences.deep ;
|
math.vectors prettyprint sequences sequences.deep ;
|
||||||
in: benchmark.pidigits
|
IN: benchmark.pidigits
|
||||||
|
|
||||||
: extract ( z x -- n )
|
: extract ( z x -- n )
|
||||||
[ first2 ] dip '[ first2 [ _ * ] [ + ] bi* ] bi@ /i ;
|
[ first2 ] dip '[ first2 [ _ * ] [ + ] bi* ] bi@ /i ;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: kernel math random ;
|
USING: kernel math random ;
|
||||||
in: benchmark.random
|
IN: benchmark.random
|
||||||
|
|
||||||
: random-benchmark ( -- )
|
: random-benchmark ( -- )
|
||||||
1,000,000 [
|
1,000,000 [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: arrays kernel literals random sequences ;
|
USING: arrays kernel literals random sequences ;
|
||||||
in: benchmark.randomize
|
IN: benchmark.randomize
|
||||||
|
|
||||||
CONSTANT: data $[ 10,000,000 iota >array ] ;
|
CONSTANT: data $[ 10,000,000 iota >array ] ;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ USING: arrays accessors generalizations io io.files io.files.temp
|
||||||
io.encodings.binary kernel math math.constants math.functions
|
io.encodings.binary kernel math math.constants math.functions
|
||||||
math.vectors math.vectors.simd math.vectors.simd.cords
|
math.vectors math.vectors.simd math.vectors.simd.cords
|
||||||
math.parser make sequences words combinators ;
|
math.parser make sequences words combinators ;
|
||||||
in: benchmark.raytracer-simd
|
IN: benchmark.raytracer-simd
|
||||||
|
|
||||||
COMPILE< SYNTAX: no-compile last-word t "no-compile" set-word-prop ; COMPILE>
|
COMPILE< SYNTAX: no-compile last-word t "no-compile" set-word-prop ; COMPILE>
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ math.constants math.functions math.vectors math.parser make
|
||||||
sequences sequences.private words hints ;
|
sequences sequences.private words hints ;
|
||||||
FROM: alien.c-types => double ;
|
FROM: alien.c-types => double ;
|
||||||
specialized-array: double
|
specialized-array: double
|
||||||
in: benchmark.raytracer
|
IN: benchmark.raytracer
|
||||||
|
|
||||||
! parameters
|
! parameters
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: math kernel hints prettyprint io combinators ;
|
USING: math kernel hints prettyprint io combinators ;
|
||||||
in: benchmark.recursive
|
IN: benchmark.recursive
|
||||||
|
|
||||||
: fib ( m -- n )
|
: fib ( m -- n )
|
||||||
dup 2 <
|
dup 2 <
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! 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 benchmark.knucleotide ;
|
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
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: arrays fry kernel math math.parser regexp sequences
|
USING: arrays fry kernel math math.parser regexp sequences
|
||||||
strings ;
|
strings ;
|
||||||
in: benchmark.regexp
|
IN: benchmark.regexp
|
||||||
|
|
||||||
: regexp-benchmark ( -- )
|
: regexp-benchmark ( -- )
|
||||||
200
|
200
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue