# Why does Array{Int}() product Array{Int, 0} and not Array{Int, 1}

**URL:** <https://discourse.julialang.org/t/why-does-array-int-product-array-int-0-and-not-array-int-1/11298>\
**Category:** New to Julia\
**Created:** [May 31, 2018, 5:29pm UTC](https://discourse.julialang.org/t/why-does-array-int-product-array-int-0-and-not-array-int-1/11298 "2018-05-31T17:29:29Z")\
**Posts on this page:** 1\
**Showing post:** 25

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [June 4, 2018, 3:02pm UTC](https://discourse.julialang.org/t/why-does-array-int-product-array-int-0-and-not-array-int-1/11298/25 "2018-06-04T15:02:22Z")

</div>

`Union{Missing, T}` is not 100% as fast as just using `T`, causes more allocations, and is not compatible with C code:

```julia
julia> struct Foo
       x::Int
       end

julia> struct FooM
       x::Union{Missing,Int}
       end

julia> function fillfoo(T,n)
       ret = Array{T}(undef, n)
       for k = 1:n
       ret[k] = T(1)
       ret
       end
       end

julia> @time fillfoo(Foo, 100000);
  0.046550 seconds (199.50 k allocations: 3.808 MiB)

julia> @time fillfoo(FooM, 100000);
  0.049624 seconds (299.50 k allocations: 8.385 MiB)

```

---

_[View the full topic](https://discourse.julialang.org/t/why-does-array-int-product-array-int-0-and-not-array-int-1/11298)._
