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

improve type stability of tail/front(::NamedTuple) #46762

Merged

Conversation

ranocha
Copy link
Member

@ranocha ranocha commented Sep 14, 2022

I improved type stability to fix some invalidations when loading ChainRulesCore.jl.. This is based on the following code:

julia> using Pkg; Pkg.activate(temp=true); Pkg.add("ChainRulesCore")

julia> using SnoopCompileCore; invalidations = @snoopr(using ChainRulesCore); using SnoopCompile

julia> trees = invalidation_trees(invalidations)
...
 inserting tail(t::Tangent{<:NamedTuple{<:Any, <:Tuple{}}}) in ChainRulesCore at ~/.julia/packages/ChainRulesCore/Z4Jry/src/tangent_types/tangent.jl:110 invalidated:
...
                 9: signature Tuple{typeof(Base.tail), Any} triggered MethodInstance for Base.tail(::NamedTuple{names}) where names (335 children)

This fixes some invalidations when loading ChainRulesCore.jl.
@ViralBShah ViralBShah merged commit e758982 into JuliaLang:master Sep 15, 2022
@ranocha ranocha deleted the hr/invalidations_ChainRulesCore branch September 15, 2022 03:37
@KristofferC KristofferC mentioned this pull request Sep 16, 2022
28 tasks
KristofferC pushed a commit that referenced this pull request Sep 16, 2022
This fixes some invalidations when loading ChainRulesCore.jl.

(cherry picked from commit e758982)
@KristofferC KristofferC removed the backport 1.8 Change should be backported to release-1.8 label Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:latency Compiler latency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants