# Storing collections of heterogeneous data

**URL:** <https://discourse.julialang.org/t/storing-collections-of-heterogeneous-data/99159>\
**Category:** General Usage\
**Tags:** data\_structures, type-stability, collections\
**Created:** [May 20, 2023, 11:02am UTC](https://discourse.julialang.org/t/storing-collections-of-heterogeneous-data/99159 "2023-05-20T11:02:44Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Zentrik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zentrik/32/35409_2.png) [@Zentrik](https://discourse.julialang.org/u/Zentrik)\
**Post date:** [May 20, 2023, 1:29pm UTC](https://discourse.julialang.org/t/storing-collections-of-heterogeneous-data/99159/7 "2023-05-20T13:29:11Z")

</div>

If I’m understanding correctly, [Virtual.jl](https://discourse.julialang.org/t/ann-virtual-jl-optimizing-dynamic-calls-away-through-virtual-multiple-dispatch/84413) should work. Sumtypes.jl or other similar packages should also perform similarly.

Alternatively, if you sort your vector and have separate for loops for the different observations that might help with vectorization.

---

_[View the full topic](https://discourse.julialang.org/t/storing-collections-of-heterogeneous-data/99159)._
