palatable / shoki

Purely functional data structures in Java
https://palatable.github.io/shoki/
MIT License
38 stars 11 forks source link

Memoizable, computable sizes / hash codes #18

Closed jnape closed 4 years ago

jnape commented 4 years ago

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.