Using `ref T` heap allocates the data which means if you have a `seq[ref int]` 
you now have a pointer indirection per each element. So your cache is going to 
get quite thrashed. Options do use a bool and that can take up more space. A 
memory efficient way of handling optionals is to use a sentinel value. An 
[example](https://play.nim-lang.org/#ix=3YBt). Optionals do also heavily 
encourage you to unpack them versus nilables.

Reply via email to