# Is Union{Missing, Float64} a concrete type?

**URL:** <https://discourse.julialang.org/t/is-union-missing-float64-a-concrete-type/65901>\
**Category:** Performance\
**Created:** [August 5, 2021, 5:37pm UTC](https://discourse.julialang.org/t/is-union-missing-float64-a-concrete-type/65901 "2021-08-05T17:37:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipelle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fipelle/32/4772_2.png) [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Post date:** [August 5, 2021, 5:37pm UTC](https://discourse.julialang.org/t/is-union-missing-float64-a-concrete-type/65901/1 "2021-08-05T17:37:00Z")

</div>

I am optimising part of a small package and I am trying to remove type instabilities. Since I am working with incomplete time series, I am using `Union{Missing, Float64}` data. I have read online that you want to use concrete types to avoid instabilities. However, I am unsure on whether unions are working fine in this context. Would you please clarify whether this is the case? Reference material / links would also be helpful.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 5, 2021, 5:57pm UTC](https://discourse.julialang.org/t/is-union-missing-float64-a-concrete-type/65901/2 "2021-08-05T17:57:31Z")

</div>

Should not be an issue:

> [@Performance tips for Union Types](https://discourse.julialang.org/t/performance-tips-for-union-types/13928):
>
> As I’ve summed up from the scattered discourse posts, the Julia compiler has been optimised for the small Union Types. Yet, it seems, there is no information about it in the Julia docs (I’ve searched in the Performance Tips section). As I understand, output Union Types break type stability, yet it is the mechanism used in the new iteration protocol and it clearly contradicts with what is written in Performance Tips. Looks like the docs need updating. It would be great to know what are the li…

but as always benchmark your concrete use case to see the impact, if there’s a problem we can see whether there’s ways around it.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [August 5, 2021, 6:53pm UTC](https://discourse.julialang.org/t/is-union-missing-float64-a-concrete-type/65901/3 "2021-08-05T18:53:04Z")

</div>

Another good (and short) read: [Union-splitting: what it is, and why you should care](https://julialang.org/blog/2018/08/union-splitting/)

---

<div class="post-metadata">

**Author:** ![fipelle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fipelle/32/4772_2.png) [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Post date:** [August 5, 2021, 7:36pm UTC](https://discourse.julialang.org/t/is-union-missing-float64-a-concrete-type/65901/4 "2021-08-05T19:36:39Z")

</div>

Thank you both! It looks like I should not worry about that then.

I will benchmark it with a specialised struct (two entries: float data and missing coordinates) and post the output if the results are interesting.
