You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some new convert method definitions cause substantial invalidation due to usage of convert in constructors. A good example is Pkg.Operations.load_direct_deps:
Here you can see that most of the inputs for creating the NamedTuple are already known to have the types needed for fields of PackageSpec. However, presumably due to specialization heuristics, that type info is lost with the constructor for NamedTuple.
I don't think this mode of invalidation is outrageously common, but I know I've seen it before, which is why I decided to report it as a systematic issue. Perhaps the NamedTuple constructor should get an extra Union-bonus in the specialization heuristics? Or is it one of the worst offenders desperately in need of limits?
There is a way to circumvent this: create a specialized PackageSpec(::PackageEntry, uuid, ver, pinned, mode) constructor. But I don't see a great way to avoid duplicating the field default specifications, which would be a bit of a code smell.
The text was updated successfully, but these errors were encountered:
Some new
convert
method definitions cause substantial invalidation due to usage ofconvert
in constructors. A good example isPkg.Operations.load_direct_deps
:From here, you can navigate to the "body method" where you get to the core issue:
Here you can see that most of the inputs for creating the
NamedTuple
are already known to have the types needed for fields ofPackageSpec
. However, presumably due to specialization heuristics, that type info is lost with the constructor forNamedTuple
.I don't think this mode of invalidation is outrageously common, but I know I've seen it before, which is why I decided to report it as a systematic issue. Perhaps the
NamedTuple
constructor should get an extraUnion
-bonus in the specialization heuristics? Or is it one of the worst offenders desperately in need of limits?There is a way to circumvent this: create a specialized
PackageSpec(::PackageEntry, uuid, ver, pinned, mode)
constructor. But I don't see a great way to avoid duplicating the field default specifications, which would be a bit of a code smell.The text was updated successfully, but these errors were encountered: