r1/scratch
author Tony Garnock-Jones <tonygarnockjones@gmail.com>
Wed, 16 Jan 2019 17:15:58 +0000
changeset 438 1fe179d53161
parent 223 646d45b098aa
permissions -rw-r--r--
Add missing primitive implementation for the plain interpreter.

1 to: 100 do: [:i|].

** Pure interpretation:
Hits: 407 Misses: 214
Hits: 411 Misses: 210
Hits: 409 Misses: 212

** After compilation to vector-instructions:
Hits: 610 Misses: 11
Hits: 618 Misses: 3
Hits: 618 Misses: 3



n@(Number traits) fib [
  (n < 2)
    ifTrue: [ n ]
    ifFalse: [ (n - 1) fib + (n - 2) fib ]
].


csi> (time (do ((i 0 (+ i 1))) ((= i 10)) (fib 20)))
    0.59 seconds elapsed
    0.09 seconds in (major) GC
       1 mutations
     111 minor GCs
      21 major GCs

.... ThiNG took 112 seconds for a (20 fib).