]> gitweb.factorcode.org Git - factor.git/commitdiff
Benchmark fixes, remove some crusty old code
authorslava <slava@factorcode.org>
Sun, 23 Apr 2006 06:24:14 +0000 (06:24 +0000)
committerslava <slava@factorcode.org>
Sun, 23 Apr 2006 06:24:14 +0000 (06:24 +0000)
library/inference/optimizer.factor
library/inference/shuffle.factor
library/test/benchmark/fib.factor
library/test/benchmark/prettyprint.factor
library/test/benchmark/sort.factor

index 02b51c3aa7aa0521df37fcf82b17c45525701da4..3984ae8fd1a9946c913f0d8fdcad2f8be7aff553 100644 (file)
@@ -24,38 +24,14 @@ GENERIC: optimize-node* ( node -- node/t )
         optimizer-changed get
     ] with-node-iterator [ optimize ] when ;
 
-: prune-if ( node quot -- successor/t )
-    over >r call [ r> node-successor ] [ r> drop t ] if ;
-    inline
-
 ! Generic nodes
 M: f optimize-node* drop t ;
 
 M: node optimize-node* ( node -- t ) drop t ;
 
-! #shuffle
-: can-compose? ( shuffle -- ? )
-    dup shuffle-in-d length swap shuffle-in-r length +
-    vregs length <= ;
-
-: compose-shuffle-nodes ( #shuffle #shuffle -- #shuffle/t )
-    [ [ node-shuffle ] 2apply compose-shuffle ] keep
-    over can-compose?
-    [ [ set-node-shuffle ] keep ] [ 2drop t ] if ;
-
-M: #shuffle optimize-node*  ( node -- node/t )
-    dup node-successor dup #shuffle? [
-        compose-shuffle-nodes
-    ] [
-        drop [
-            dup node-in-d over node-out-d sequence=
-            >r dup node-in-r swap node-out-r sequence= r> and
-        ] prune-if
-    ] if ;
-
 ! #push
 M: #push optimize-node*  ( node -- node/t )
-    [ node-out-d empty? ] prune-if ;
+    dup node-out-d empty? [ node-successor ] [ drop t ] if ;
 
 ! #return
 M: #return optimize-node* ( node -- node/t )
index 5baa5f21b9d767d072d46e3d5c3e2970cfe07bf0..3f783845c6191450e6be8554d0f0d3940d2df937 100644 (file)
@@ -51,28 +51,6 @@ TUPLE: shuffle in-d in-r out-d out-r ;
     #! the shuffle.
     [ split-shuffle ] keep shuffle* join-shuffle ;
 
-: fix-compose-d ( s1 s2 -- )
-    over shuffle-out-d over shuffle-in-d [ length ] 2apply < [
-        over shuffle-out-d length over shuffle-in-d head*
-        [ pick shuffle-in-d append pick set-shuffle-in-d ] keep
-        pick shuffle-out-d append pick set-shuffle-out-d
-    ] when 2drop ;
-
-: fix-compose-r ( s1 s2 -- )
-    over shuffle-out-r over shuffle-in-r [ length ] 2apply < [
-        over shuffle-out-r length over shuffle-in-r head*
-        [ pick shuffle-in-r append pick set-shuffle-in-r ] keep
-        pick shuffle-out-r append pick set-shuffle-out-r
-    ] when 2drop ;
-
-: compose-shuffle ( s1 s2 -- s1+s2 )
-    #! s1's d and r output lengths must be at least the required
-    #! length for the shuffle. If they are not, a special
-    #! behavior is used which is only valid for the optimizer.
-    [ clone ] 2apply 2dup fix-compose-d 2dup fix-compose-r
-    >r dup shuffle-out-d over shuffle-out-r r> shuffle
-    >r >r dup shuffle-in-d swap shuffle-in-r r> r> <shuffle> ;
-
 M: shuffle clone ( shuffle -- shuffle )
     [ shuffle-in-d clone ] keep
     [ shuffle-in-r clone ] keep
index 0528391b57b481664e83ef6da1e38c62b8eadfa5..df554852107e4bb562f760493e9b6acc94d96b54 100644 (file)
@@ -54,4 +54,4 @@ SYMBOL: n
         ] if
     ] with-scope ; compiled
 
-[ 9227465 ] [ 34 namespace-fib ] unit-test
+[ 1346269 ] [ 30 namespace-fib ] unit-test
index fa2f583b01c4eb5ad9d7a5d02680a3a2d610f162..fbda45ac916a6e81f4447fcbc2aea57ad16d015d 100644 (file)
@@ -5,5 +5,8 @@ USE: test
 USE: words
 USE: kernel
 USE: sequences
+USE: io
 
-[ ] [ vocabs [ words [ see ] each ] each ] unit-test
+[ ] [
+    [ vocabs [ words [ see ] each ] each ] string-out drop
+] unit-test
index 806dd786e950308a27c5f03304fb1f1b1e5fc07b..2fdde603e7047dbca747c20df228e03c81c55bf8 100644 (file)
@@ -2,6 +2,6 @@ IN: temporary
 USING: compiler kernel math sequences test ;
 
 : sort-benchmark
-    100000 [ drop 100000 random-int ] map number-sort drop ; compiled
+    100000 [ drop 100000 random-int ] map natural-sort drop ; compiled
 
 [ ] [ sort-benchmark ] unit-test