# Invalidations findings (from a GMT case)

**URL:** <https://discourse.julialang.org/t/invalidations-findings-from-a-gmt-case/92420>\
**Category:** General Usage\
**Tags:** performance\
**Created:** [January 2, 2023, 2:55pm UTC](https://discourse.julialang.org/t/invalidations-findings-from-a-gmt-case/92420 "2023-01-02T14:55:54Z")\
**Posts on this page:** 5\
**Page:** 4

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [January 8, 2023, 10:41am UTC](https://discourse.julialang.org/t/invalidations-findings-from-a-gmt-case/92420/61 "2023-01-08T10:41:58Z")

</div>

> [@joa-quim](#):
>
> is so (if I’m understanding this matters) because a [GMTdataset](https://github.com/GenericMappingTools/GMT.jl/blob/master/src/gmt_main.jl#L105) is an abstract array, so all other types that implement the abstract array interface are candidates to suffer from these inference issues.

No. It’s the same reason that

```julia
julia> isconcretetype(Array)
false

julia> isconcretetype(Tuple)
false

julia> isconcretetype(Pair)
false

```

but

```julia
julia> isconcretetype(Array{Float32,3})
true

julia> isconcretetype(Tuple{Int,String})
true

julia> isconcretetype(Pair{Symbol,Any})
true

```

Until all the parameters are specified, it’s not concrete. As I said above, “Any time you have abstract parameters you will get inference failures.”

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [January 12, 2023, 2:59pm UTC](https://discourse.julialang.org/t/invalidations-findings-from-a-gmt-case/92420/62 "2023-01-12T14:59:25Z")

</div>

> [@kristoffer.carlsson](#):
>
> > [@joa-quim](#):
> >
> > Unfortunately not yet.
> 
> Pkg has not been updated on master yet.

I believe it has now, right? Sorry, but it made no difference.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [January 12, 2023, 3:44pm UTC](https://discourse.julialang.org/t/invalidations-findings-from-a-gmt-case/92420/63 "2023-01-12T15:44:24Z")

</div>

> [@joa-quim](#):
>
> I believe it has now, right? Sorry, but it made no difference.

I ran it:

```julia
                 34: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for convert(::Type{Union{Nothing, String}}, ::Any) (12 children)
                 35: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for REPL.REPLHistoryProvider(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (12 children)
                 36: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for setindex!(::Vector{String}, ::Any, ::Int64) (28 children)
                 37: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for convert(::Type{Pair{String, String}}, ::Pair{String}) (39 children)
                 38: signature Tuple{typeof(convert), Union{Type{String}, Type{Union{Nothing, VersionNumber}}}, Any} triggered MethodInstance for (::Base.var"#cvt1#1"{Tuple{String, Union{Nothing, VersionNumber}}})(::Int64) (151 children)
                 39: signature Tuple{typeof(convert), Type{String}, Any} triggered MethodInstance for Base.CoreLogging.var"#handle_message#2"(::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}}, ::typeof(Base.CoreLogging.handle_message), ::Base.CoreLogging.SimpleLogger, ::Base.CoreLogging.LogLevel, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) (975 children)

```

Number 38 of those should be fixed by [add some type annotations to improve type stability by KristofferC · Pull Request #3309 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/pull/3309).  
The rest seems unrelated to Pkg.

The last one is worse with so many children but it is unclear to me why that came up all of a sudden.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [January 12, 2023, 4:22pm UTC](https://discourse.julialang.org/t/invalidations-findings-from-a-gmt-case/92420/64 "2023-01-12T16:22:12Z")

</div>

How can you tell that 38 is related to Pkg but the others _seems unrelated_?  
They are all under the hat of

```julia
inserting convert(::Type{String}, d::StringManipulation.Decoration) @ StringManipulation C:\Users\joaqu\.julia\packages\StringManipulation\wxRU4\src\decorations.jl:193 invalidated:

```

Note: asking for learning purposes

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [January 12, 2023, 8:46pm UTC](https://discourse.julialang.org/t/invalidations-findings-from-a-gmt-case/92420/65 "2023-01-12T20:46:39Z")

</div>

Well, I couldn’t see anything directly related to Pkg in them but you are right that one should go down with `ascend` to see what the root cause is.

[Previous page](https://discourse.julialang.org/t/invalidations-findings-from-a-gmt-case/92420.md?page=3)
