# What is the Julia equivalent of Rust Option\<T\>?

**URL:** <https://discourse.julialang.org/t/what-is-the-julia-equivalent-of-rust-option-t/122134>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [November 1, 2024, 1:55pm UTC](https://discourse.julialang.org/t/what-is-the-julia-equivalent-of-rust-option-t/122134 "2024-11-01T13:55:09Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [November 1, 2024, 4:03pm UTC](https://discourse.julialang.org/t/what-is-the-julia-equivalent-of-rust-option-t/122134/13 "2024-11-01T16:03:39Z")

</div>

Regarding performance, non type-stable stuff like `missing` and `nothing` can easily be orders of magnitude slower than the corresponding type-stable code. Whenever the type has a natural sentinel value, like `NaN` for floats, it’s worth using that.

See a simple example of `missing` being more than two orders of magnitude slower than `NaN` in current Julia at [Is there any reason to use NaN instead of missing? - #4 by aplavin](https://discourse.julialang.org/t/is-there-any-reason-to-use-nan-instead-of-missing/84396/4) and [order of magnitude type-unstable performance regression · Issue #50130 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/50130).

---

_[View the full topic](https://discourse.julialang.org/t/what-is-the-julia-equivalent-of-rust-option-t/122134)._
