# Container type declaration when computing equivalence classes for performance vs genericity

**URL:** https://discourse.julialang.org/t/container-type-declaration-when-computing-equivalence-classes-for-performance-vs-genericity/64353
**Category:** New to Julia
**Tags:** performance
**Created:** [July 9, 2021, 1:48pm UTC](https://discourse.julialang.org/t/container-type-declaration-when-computing-equivalence-classes-for-performance-vs-genericity/64353 "2021-07-09T13:48:39Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [July 9, 2021, 2:30pm UTC](https://discourse.julialang.org/t/container-type-declaration-when-computing-equivalence-classes-for-performance-vs-genericity/64353/2 "2021-07-09T14:30:30Z")

</div>

If, for example, `class` is of type `MyClass` initialize `partition` with:

```julia
partition = MyClass[]

```

or, if you feel to be more explicit,

```julia
partition = Vector{MyClass}(undef,0)

```

But all this should be inside a function, otherwise `partition` will be type unstable anyway.

---

_[View the full topic](https://discourse.julialang.org/t/container-type-declaration-when-computing-equivalence-classes-for-performance-vs-genericity/64353)._
