Code optimization with Scala

What Scala structures can be used more efficiently than in Java to increase execution speed? I donโ€™t know if this is possible, but to remove my doubts :)

thank

+5
source share
4 answers

scala @ specialized annotation can generate several versions of a class that are finely tuned with certain primitive types. You can write all this in Java, but you probably don't want this.

+9
source

2.9, . " " . Java .

, Scala , Java, , .

+6

, @specialized . , Java fastutil Apache Primitives . Scala @specialized :

class MyLinkedList[@specialized T] (args: T*) {
  // whatever it does
}

, . 2.9 , , , Scala Java (fold, foreach ..). . ScalaDays .

+6

, Java-, Scala , , HotSpot.

Also stay tuned for an Iulian theme , which is due out soon and will provide much more information about the Scala optimization theme.

+2
source

All Articles