Skip to content

Instantly share code, notes, and snippets.

@lojikil
Created March 12, 2012 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lojikil/2023866 to your computer and use it in GitHub Desktop.
Save lojikil/2023866 to your computer and use it in GitHub Desktop.
$ time ./run_hydra.ss hydra_s1.ss
55
6765
832040
2178309
real 0m0.830s
user 0m0.655s
sys 0m0.046s
$ time gosh s1.ss
55
6765
832040
2178309
real 0m0.139s
user 0m0.015s
sys 0m0.061s
$ time vesta s1.ss
55
6765
832040
2178309
real 0m0.143s
user 0m0.046s
sys 0m0.016s
the `run_hydra.ss` above is Vesta loading `hydra.ss` and then calling `hydra@load` on it.
@lojikil
Copy link
Author

lojikil commented Mar 12, 2012

Once I update Enyo to the point where it can compile Hydra, this will be a more meaningful benchmark, but it isn't bad that Hydra is still running in less than a second on this:

(define (fib i j n)
    (if (<= n 0)
            i
            (fib (+ i j) i (- n 1))))
(define (scheme_main)
    (display (fib 0 1 10))
    (display "\n")
    (display (fib 0 1 20))
    (display "\n")
    (display (fib 0 1 30))
    (display "\n")
    (display (fib 0 1 32))
    (display "\n"))
(scheme_main)

I haven't installed newline as a primitive in Hydra yet, so that is why there is a hydra_s1.ss file (although this could be used on all three interpreters...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment