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

get rid of some invalidation sources in Artifacts #37605

Merged
merged 3 commits into from
Sep 17, 2020
Merged

Conversation

KristofferC
Copy link
Sponsor Member

@KristofferC KristofferC commented Sep 16, 2020

Found with SnoopCompile and loading Plots.

Not sure if this is the best way to resolve them but it does the job. @timholy?

@@ -610,24 +620,24 @@ end
# Support `AbstractString`s, but avoid compilers needing to track backedges for callers
# of these functions in case a user defines a new type that is `<: AbstractString`
with_artifacts_directory(f::Function, artifacts_dir::AbstractString) =
with_artifacts_directory(f, string(artifacts_dir))
with_artifacts_directory(f, String(artifacts_dir)::String)
Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are just fixes so that the code adheres to what the comment claims it does.

@@ -270,7 +271,12 @@ function unpack_platform(entry::Dict, name::String, artifacts_toml::String)::Uni
end

# Collect all String-valued mappings in `entry` and use them as tags
tags = Dict(Symbol(k) => v for (k, v) in entry if isa(v, String))
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Symbol(k)::Symbol => v::String might also work, but your version is good.

@KristofferC KristofferC added the compiler:latency Compiler latency label Sep 16, 2020
Copy link
Sponsor Member

@staticfloat staticfloat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@staticfloat
Copy link
Sponsor Member

Looks like the keys to the dictionary passed to unpack_platform are not Strings, but possibly substrings.

@KristofferC
Copy link
Sponsor Member Author

Looks like the keys to the dictionary passed to unpack_platform are not Strings, but possibly substrings.

I tweaked things a bit.

Basically, we have a "funnel" where the top methods accept wide types and convert them to known concrete types for which the core implementations are defined on. This means that the core parts will not be invalidated since they have concrete type information while things should still accept generic types.

@KristofferC KristofferC merged commit 9b81a8a into master Sep 17, 2020
@KristofferC KristofferC deleted the kc/artifacts branch September 17, 2020 21:31
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.

3 participants