Slide 35
Slide 35 text
Fringe81 Co., Ltd.
パフォーマンス観点ではどれくらい変わる?
How different is it from a performance point of view?
object Normal {
case class User(id: Id, name: Name)
case class Id(value: Long)
case class Name(value: String)
}
Normal.User(Normal.Id(1L), Normal.Name("hoge"))
object Value {
// not Value-class
case class UserValue(id: IdValue, name: NameValue)
case class IdValue(value: Long) extends AnyVal
case class NameValue(value: String) extends AnyVal
}
Value.UserValue(Value.IdValue(1L), Value.NameValue("hoge"))