Computing the size and the hash code adds significant constant overhead for methods like StrictStack#cons, whereas if the size and hash code were computations that could be memoized, they would be amortized O(1) and have a negligible time cost on these hot path operations.
Computing the size and the hash code adds significant constant overhead for methods like
StrictStack#cons
, whereas if the size and hash code were computations that could be memoized, they would be amortizedO(1)
and have a negligible time cost on these hot path operations.