You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In LazyList, an evaluated value is stored in the lazy val state: State[A], which contains an instance of final class Cons[A](val head: A, val tail: LazyList[A]) extends State[A].
So for every evaluated value there's an instance of LazyList plus an instance of Cons.
JOL output for a LazyList with 100 forced new AnyRefs:
24 bytes is the minimal size as we need two fields (head and tail).
Fortunately, LazyList internals are all private, so there's a chance to fix it. Serialization is already custom, so it's hopefully possible to remain unchanged.
The text was updated successfully, but these errors were encountered:
In LazyList, an evaluated value is stored in the
lazy val state: State[A]
, which contains an instance offinal class Cons[A](val head: A, val tail: LazyList[A]) extends State[A]
.So for every evaluated value there's an instance of LazyList plus an instance of Cons.
JOL output for a LazyList with 100 forced
new AnyRef
s:Compare with Stream:
24 bytes is the minimal size as we need two fields (
head
andtail
).Fortunately, LazyList internals are all private, so there's a chance to fix it. Serialization is already custom, so it's hopefully possible to remain unchanged.
The text was updated successfully, but these errors were encountered: