Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type instability on using @code_warntype Colorbar(fig[1, 2]) in GLMakie.jl #4696

Closed
raman-maker opened this issue Dec 31, 2024 · 4 comments
Closed

Comments

@raman-maker
Copy link

MethodInstance for Colorbar(::GridPosition)
from (::Type{T})(args...; kwargs...) where T<:Block @ Makie ~/.julia/packages/Makie/tjqse/src/makielayout/blocks.jl:236
Static Parameters
T = Colorbar
Arguments
#self#::Core.Const(Colorbar)
args::Tuple{GridPosition}
Body::Any
1 ─ %1 = Makie.:(var"##1440")::Core.Const(Makie.var"##1440")
│ %2 = Core.NamedTuple()::Core.Const(NamedTuple())
│ %3 = Base.pairs(%2)::Core.Const(Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}())
│ %4 = Core.tuple(%3, #self#)::Core.Const((Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}(), Colorbar))
│ %5 = Core._apply_iterate(Base.iterate, %1, %4, args)::Any
└── return %5

@SimonDanisch
Copy link
Member

What's the problem here?
Why should this be type stable?

@raman-maker
Copy link
Author

I got type instability in my code. I want to get better performance by making it type stable. See Body::Any

@jkrumbiegel
Copy link
Member

jkrumbiegel commented Dec 31, 2024

Most of Makie is type unstable as it handles input types dynamically. It's very unlikely you will find performance gains using @code_warntype on user API level code, either this needs systemwide refactors or optimizations in specific low level functions for rendering.

@raman-maker
Copy link
Author

Ok, so i will ignore this @code_warntype message for GLMakie. Thanks.

@jkrumbiegel jkrumbiegel closed this as not planned Won't fix, can't repro, duplicate, stale Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants