# Dramatic performance change by adding additional unused method

**URL:** https://discourse.julialang.org/t/dramatic-performance-change-by-adding-additional-unused-method/71771
**Category:** Performance
**Created:** [November 19, 2021, 11:56am UTC](https://discourse.julialang.org/t/dramatic-performance-change-by-adding-additional-unused-method/71771 "2021-11-19T11:56:03Z")
**Posts on this page:** 1
**Showing post:** 22

<div class="post-metadata">

### Author: ![peremato](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peremato/32/29128_2.png) [@peremato](https://discourse.julialang.org/u/peremato)
#### Post date: [November 19, 2021, 4:08pm UTC](https://discourse.julialang.org/t/dramatic-performance-change-by-adding-additional-unused-method/71771/22 "2021-11-19T16:08:56Z")

</div>

I tried with having a Vector of abstract types. Like this:

```julia
abstract type AbstractPlacement{T<:AbstractFloat} end

#---Volume-------------------------------------------------------------------------
struct Volume{T<:AbstractFloat, S<:AbstractShape{T}, M<:AbstractMaterial}
    label::String
    shape::S # Reference to the actual shape
    material::M # Reference to material
    daughters::Vector{AbstractPlacement{T}}
end

#---PlacedVolume-------------------------------------------------------------------
struct PlacedVolume{T<:AbstractFloat,S<:AbstractShape{T}, M<:AbstractMaterial} <: AbstractPlacement{T}
    transformation::Transformation3D{T}
    volume::Volume{T,S,M}
end

Volume{T}(label::String, shape::S, material::M) where {T,S,M} = Volume{T,S,M}(label, shape, material, Vector{AbstractPlacement{T}}())

```

The performance is twice worst than what I had originally.

---

_[View the full topic](https://discourse.julialang.org/t/dramatic-performance-change-by-adding-additional-unused-method/71771)._
