Repository navigation
Reduce the exposed length(r) methods for ranges - #227
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #227 +/- ##
=======================================
Coverage 99.62% 99.62%
=======================================
Files 3 3
Lines 267 268 +1
=======================================
+ Hits 266 267 +1
Misses 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
Before (with FPN v0.9.2): julia> using SnoopCompileCore
julia> using ModelingToolkit
julia> invs = @snoop_invalidations using ColorVectorSpace;
julia> using SnoopCompile
julia> trees = invalidation_trees(invs)
12-element Vector{SnoopCompile.MethodInvalidations}:
inserting checked_mul(x::Real, ::Type{X}) where X<:FixedPoint @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:62 invalidated:
mt_backedges: 1: signature Tuple{typeof(Base.Checked.checked_mul), Int64, Any} triggered MethodInstance for (::Base.BottomRF{typeof(Base.Checked.checked_mul)})(::Int64, ::Any) (0 children)
2: signature Tuple{typeof(Base.Checked.checked_mul), Int64, Any} triggered MethodInstance for (::Base.BottomRF{typeof(Base.Checked.checked_mul)})(::Int64, ::Any) (0 children)
inserting reinterpret(::Type{X}, x::T) where {T<:Integer, X<:(FixedPoint{T})} @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:48 invalidated:
backedges: 1: superseding reinterpret(::Type{Out}, x) where Out @ Base essentials.jl:785 with MethodInstance for reinterpret(::Type, ::UInt16) (1 children)
inserting promote_rule(::Type{X1}, ::Type{X2}) where {T1, f1, X1<:FixedPoint{T1, f1}, T2, f2, X2<:FixedPoint{T2, f2}} @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:536 invalidated:
backedges: 1: superseding promote_rule(::Type, ::Type) @ Base promotion.jl:334 with MethodInstance for promote_rule(::Type, ::Type) (4 children)
inserting Float64(x::FixedPointNumbers.Normed{UInt128, f}) where f @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/normed.jl:235 invalidated:
mt_backedges: 1: signature Tuple{Type{Float64}, Number} triggered MethodInstance for Base.Broadcast.combine_eltypes(::Type{Float64}, ::Tuple{Vector{Number}}) (2 children)
2: signature Tuple{Type{Float64}, Any} triggered MethodInstance for Base.Broadcast.combine_eltypes(::Type{Float64}, ::Tuple{Matrix{Any}}) (2 children)
3: signature Tuple{Type{Float64}, Any} triggered MethodInstance for Base.Broadcast.combine_eltypes(::Type{Float64}, ::Tuple{Vector{Any}}) (2 children)
inserting promote_rule(::Type{T}, ::Type{C}) where {T<:Real, C<:AbstractGray} @ ColorVectorSpace ~/.julia/dev/ColorVectorSpace/src/ColorVectorSpace.jl:37 invalidated:
backedges: 1: superseding promote_rule(::Type, ::Type) @ Base promotion.jl:334 with MethodInstance for promote_rule(::Type{Num}, ::DataType) (8 children)
inserting (::Type{Ti})(x::FixedPointNumbers.FixedPoint) where Ti<:Integer @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:86 invalidated:
mt_backedges: 1: signature Tuple{Type{Int64}, Number} triggered MethodInstance for Base.Broadcast.combine_eltypes(::Type{Int64}, ::Tuple{Vector{Number}}) (10 children)
inserting reduce_first(::typeof(Base.mul_prod), x::FixedPointNumbers.FixedPoint) @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:563 invalidated:
backedges: 1: superseding reduce_first(::typeof(Base.mul_prod), x) @ Base reduce.jl:408 with MethodInstance for Base.reduce_first(::typeof(Base.mul_prod), ::Any) (33 children)
inserting checked_mul(x::X, y::X) where X<:FixedPoint @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:290 invalidated:
mt_backedges: 1: signature Tuple{typeof(Base.Checked.checked_mul), Any, Any} triggered MethodInstance for checked_mul(::Int64, ::Integer) (0 children)
2: signature Tuple{typeof(Base.Checked.checked_mul), Any, Any} triggered MethodInstance for checked_mul(::Int64, ::Integer) (3 children)
3: signature Tuple{typeof(Base.Checked.checked_mul), Any, Any} triggered MethodInstance for (::Base.BottomRF{typeof(Base.Checked.checked_mul)})(::Any, ::Any) (31 children)
inserting floor(::Type{T}, g::ColorTypes.Gray) where T<:Integer @ ColorVectorSpace ~/.julia/dev/ColorVectorSpace/src/ColorVectorSpace.jl:185 invalidated:
backedges: 1: superseding floor(::Type{T}, x) where T @ Base rounding.jl:484 with MethodInstance for floor(::Type{Int64}, ::Any) (142 children)
inserting reduce_first(::typeof(Base.add_sum), x::FixedPointNumbers.FixedPoint) @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:560 invalidated:
backedges: 1: superseding reduce_first(::typeof(Base.add_sum), x) @ Base reduce.jl:405 with MethodInstance for Base.reduce_first(::typeof(Base.add_sum), ::Any) (273 children)
inserting -(x::X) where X<:FixedPoint @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:332 invalidated:
mt_backedges: 1: signature Tuple{typeof(-), Number} triggered MethodInstance for Base.Broadcast.combine_eltypes(::typeof(-), ::Tuple{Vector{Number}}) (20 children)
2: signature Tuple{typeof(-), Number} triggered MethodInstance for Base.Broadcast.combine_eltypes(::typeof(-), ::Tuple{Vector{Number}}) (1140 children)
inserting length(r::StepRange{<:ColorTypes.AbstractGray, <:ColorTypes.AbstractGray}) @ ColorVectorSpace ~/.julia/dev/ColorVectorSpace/src/ColorVectorSpace.jl:460 invalidated:
backedges: 1: superseding length(r::StepRange{<:Dates.TimeType}) @ Dates ~/.julia/juliaup/julia-1.13.2+0.x64.linux.gnu/share/julia/stdlib/v1.13/Dates/src/ranges.jl:25 with MethodInstance for length(::StepRange{<:Dates.TimeType}) (30424 children)After (with FPN v0.9.2): julia> trees = invalidation_trees(invs)
11-element Vector{SnoopCompile.MethodInvalidations}:
inserting checked_mul(x::Real, ::Type{X}) where X<:FixedPoint @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:62 invalidated:
mt_backedges: 1: signature Tuple{typeof(Base.Checked.checked_mul), Int64, Any} triggered MethodInstance for (::Base.BottomRF{typeof(Base.Checked.checked_mul)})(::Int64, ::Any) (0 children)
2: signature Tuple{typeof(Base.Checked.checked_mul), Int64, Any} triggered MethodInstance for (::Base.BottomRF{typeof(Base.Checked.checked_mul)})(::Int64, ::Any) (0 children)
inserting reinterpret(::Type{X}, x::T) where {T<:Integer, X<:(FixedPoint{T})} @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:48 invalidated:
backedges: 1: superseding reinterpret(::Type{Out}, x) where Out @ Base essentials.jl:785 with MethodInstance for reinterpret(::Type, ::UInt16) (1 children)
inserting promote_rule(::Type{X1}, ::Type{X2}) where {T1, f1, X1<:FixedPoint{T1, f1}, T2, f2, X2<:FixedPoint{T2, f2}} @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:536 invalidated:
backedges: 1: superseding promote_rule(::Type, ::Type) @ Base promotion.jl:334 with MethodInstance for promote_rule(::Type, ::Type) (4 children)
inserting Float64(x::FixedPointNumbers.Normed{UInt128, f}) where f @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/normed.jl:235 invalidated:
mt_backedges: 1: signature Tuple{Type{Float64}, Number} triggered MethodInstance for Base.Broadcast.combine_eltypes(::Type{Float64}, ::Tuple{Vector{Number}}) (2 children)
2: signature Tuple{Type{Float64}, Any} triggered MethodInstance for Base.Broadcast.combine_eltypes(::Type{Float64}, ::Tuple{Matrix{Any}}) (2 children)
3: signature Tuple{Type{Float64}, Any} triggered MethodInstance for Base.Broadcast.combine_eltypes(::Type{Float64}, ::Tuple{Vector{Any}}) (2 children)
inserting promote_rule(::Type{T}, ::Type{C}) where {T<:Real, C<:AbstractGray} @ ColorVectorSpace ~/.julia/dev/ColorVectorSpace/src/ColorVectorSpace.jl:37 invalidated:
backedges: 1: superseding promote_rule(::Type, ::Type) @ Base promotion.jl:334 with MethodInstance for promote_rule(::Type{Num}, ::DataType) (8 children)
inserting (::Type{Ti})(x::FixedPointNumbers.FixedPoint) where Ti<:Integer @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:86 invalidated:
mt_backedges: 1: signature Tuple{Type{Int64}, Number} triggered MethodInstance for Base.Broadcast.combine_eltypes(::Type{Int64}, ::Tuple{Vector{Number}}) (10 children)
inserting reduce_first(::typeof(Base.mul_prod), x::FixedPointNumbers.FixedPoint) @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:563 invalidated:
backedges: 1: superseding reduce_first(::typeof(Base.mul_prod), x) @ Base reduce.jl:408 with MethodInstance for Base.reduce_first(::typeof(Base.mul_prod), ::Any) (33 children)
inserting checked_mul(x::X, y::X) where X<:FixedPoint @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:290 invalidated:
mt_backedges: 1: signature Tuple{typeof(Base.Checked.checked_mul), Any, Any} triggered MethodInstance for checked_mul(::Int64, ::Integer) (0 children)
2: signature Tuple{typeof(Base.Checked.checked_mul), Any, Any} triggered MethodInstance for checked_mul(::Int64, ::Integer) (3 children)
3: signature Tuple{typeof(Base.Checked.checked_mul), Any, Any} triggered MethodInstance for (::Base.BottomRF{typeof(Base.Checked.checked_mul)})(::Any, ::Any) (31 children)
inserting floor(::Type{T}, g::ColorTypes.Gray) where T<:Integer @ ColorVectorSpace ~/.julia/dev/ColorVectorSpace/src/ColorVectorSpace.jl:185 invalidated:
backedges: 1: superseding floor(::Type{T}, x) where T @ Base rounding.jl:484 with MethodInstance for floor(::Type{Int64}, ::Any) (141 children)
inserting reduce_first(::typeof(Base.add_sum), x::FixedPointNumbers.FixedPoint) @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:560 invalidated:
backedges: 1: superseding reduce_first(::typeof(Base.add_sum), x) @ Base reduce.jl:405 with MethodInstance for Base.reduce_first(::typeof(Base.add_sum), ::Any) (273 children)
inserting -(x::X) where X<:FixedPoint @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/l6dW1/src/FixedPointNumbers.jl:332 invalidated:
mt_backedges: 1: signature Tuple{typeof(-), Number} triggered MethodInstance for Base.Broadcast.combine_eltypes(::typeof(-), ::Tuple{Vector{Number}}) (20 children)
2: signature Tuple{typeof(-), Number} triggered MethodInstance for Base.Broadcast.combine_eltypes(::typeof(-), ::Tuple{Vector{Number}}) (1140 children) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the same type of invalidation measure as JuliaMath/FixedPointNumbers.jl#339