4 ms·
># Generally, on an average, 1 line of Scala = 10 lines of Java. That's less maintainable LOC (it can be argued otherwise, but just assume it's a good thing) >
by ShardPhoenix 13y ago
># Generally, on an average, 1 line of Scala = 10 lines of Java. That's less maintainable LOC (it can be argued otherwise, but just assume it's a good thing)
># Performance. Now this is where Scala really shines. Scala's base performance is almost near Java's in most real world scenarios.
Scala's great, but don't overhype it. I just finished re-writing a mid-sized (~30k LOC) API app from Java (Play 1) to Scala (Scalatra). In this case the code size was reduced to about 40% of the original, but we needed about 50% more CPU and 100% more RAM to get comparable performance.
It was still well worth it - aside from the reduction in the size of the code there are additional maintainability benefits from immutability and other nice aspects of idiomatic Scala.
- neya 13y agoWow! But, I am not sure, I think it varies with individual use-cases. The last time I checked for a simple CRUD app, I got a good 85% performance of the Java equivalent.
- ShardPhoenix 13y agoIn this app we're doing a lot of serializing and deserializing of large JSON objects (using Jackson in Java and Json4S-Jackson in Scala), which is the main performance bottleneck.
- neya 13y agoThank you for the useful insight! :)