Scala High Performance Programming
Rate it:
Started reading March 13, 2018
27%
Flag icon
boxing. The JVM defines primitive types (boolean, byte, char, float, int, long, short, and double) that are stack-allocated rather than heap-allocated. When a generic type is introduced, for example, scala.collection.immutable.List, the JVM references an object equivalent, instead of a primitive type. In this example, an instantiated list of integers would be heap-allocated objects rather than integer primitives. The process of converting
60%
Flag icon
As the volume of your data and the transformation count increase, it becomes more likely that a view offers better performance. Here, you see the tangible benefit of avoiding intermediate collections. A second axis of performance to consider is the nature of the transformation. Transformations that benefit from early termination (for example, find), benefit strongly from lazy evaluation. This benchmark illustrates that it is important to understand the size of your data and