Closed siddhartha-gadgil closed 3 years ago
A related change in terms of code (but with different effect). A slight speedup was obtained by memoizing hashes (which are computed a lot since we use maps and group stuff). This is accomplished by using the following code (from StackOverflow) which memoizes the hash code:
override val hashCode: Int = scala.util.hashing.MurmurHash3.productHash(this)
While writing tuple methods for all the case classes, it will be worth doing this too.
The problem
upickle
is clean and easy, the generated files are very large - huge in the case of the map from paths to unique classes.upack
is used to binary serialize we get a smaller file, but only by a factor of 2/3.Solution
type Cpt = (Int, BigDecimal, Boolean)
or equivalent.fromCpt(cpt: Cpt): SkewCurve
or equivalent.upickle
(with upack for efficiency) or something else (e.g. Boopickle).