• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java 8 vs Scala performance

 
Kerim Kara
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you have a chance to benchmark Java 8 FP and/or Scala performance...

if there is , apart from Tail recursion call , what other elements in Java 8 contribute to performance difference with Scala

Thanks
 
Pierre-Yves Saumont
Author
Ranch Hand
Posts: 94
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have not conducted very precise benchmarks. There is however one main reason for Scala programs to be faster than the programs you will be able to write with the elements developed in the book: optimization. Most Scala structures are implemented in imperative style when maximum performance is needed, using mutable variables internally. On contrary, most structures presented in the book are implemented in functional style, for pedagogical reasons. If we were designing a functional library, we would probably be tempted to do the same as Scala. However, most of the functional structures that I present have been used in production for several years (starting with a Java 6 version!) giving good enough performance.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!