July 2017
Intermediate to advanced
796 pages
18h 55m
English
Sometimes, there are several benchmarking questions arrived for example: A Lists faster than Vectors for what you're doing or are Vectors faster than Lists? How much memory can you save using unboxed Arrays to store primitives? When you do performance tricks such as pre-allocating arrays or using a while loop instead of a foreach call, how much does it really matter? var l: List or val b: mutable.Buffer? Memory usage can be estimated using different Scala benchmark codes, for example, refer to https://github.com/lihaoyi/scala-bench.
Table 6 here shows the estimated size (bytes) of the various immutable collections of 0-elements, 1- element, 4- elements, and powers of four all the way up to 1,048,576 elements. ...
Read now
Unlock full access