# Cache Data Structure for Lazy Array

**URL:** <https://discourse.julialang.org/t/cache-data-structure-for-lazy-array/102388>\
**Category:** Performance\
**Tags:** data\_structures\
**Created:** [August 2, 2023, 10:12am UTC](https://discourse.julialang.org/t/cache-data-structure-for-lazy-array/102388 "2023-08-02T10:12:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [August 2, 2023, 11:51am UTC](https://discourse.julialang.org/t/cache-data-structure-for-lazy-array/102388/2 "2023-08-02T11:51:34Z")

</div>

People typically use `Dict` for this sort of thing, e.g. in [Memoize.jl](https://github.com/JuliaCollections/Memoize.jl). You can define a [custom key type with an optimized `hash` function](https://discourse.julialang.org/t/poor-time-performance-on-dict/9656/14) to speed things up if you know more about your keys.

---

_[View the full topic](https://discourse.julialang.org/t/cache-data-structure-for-lazy-array/102388)._
