Go to content

Is scala code slow? - Roman Grebennikov

Scala language has a lot of amazing features like type safety, pattern matching, recursion, lambdas and other functional things combined together in a way that makes developer happier. But all these dreams about functional magic can be easily broken by the cases like "when I rewrote all my spaghetti Java code to a Scala one-liner, why did it become three times slower?". Harsh reality shows us that all these modern high-level abstractions may hide monsters inside and a comfort you get by using them comes at a price. So if you develop something more complex than a simple CRUD application and it's even slightly connected with performance, you have to clearly understand how all these "monads" behave under the hood. This talk will tell you about a magic performed by the scala compiler, show a couple of horror stories about scala application performance with explanations and solutions: What happens when you hit 'compile & run' button. Pattern-matching, tail recursion and collections case stories. JMH and how to use it with your Scala code. How HotSpot optimises your code. ... and a bit more about Scala 2.12 improvements.

October 27, 2016