The Scala Fibonacci code performs 5-6 times worse than an imperative 
iterative Java implementation:

casper@workstation:~$ time java -cp /usr/share/java/scala-library.jar:. 
ScalaFib
4613732

real 0m0.243s
user 0m0.292s
sys 0m0.020s

casper@workstation:~$ time java JavaFib
4613732

real 0m0.052s
user 0m0.040s
sys 0m0.008s

Frankly, that's a much higher penalty than I would've thought. Lack of 
tail-recursion? (Scala 2.9, OpenJDK 1.6.0_23)

Btw. this functional style has also been possible in C# since .NET 3.0 
(2006).

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/javaposse/-/vQC8355GhnsJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to