-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
decrease method count for eltype
for Tuple
, decrease max_methods
#58788
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
base: master
Are you sure you want to change the base?
decrease method count for eltype
for Tuple
, decrease max_methods
#58788
Conversation
FTR: in another PR I'll try to reduce the
Furthermore I'll try reducing the
|
The `eltype` function was one of the few functions in the sysimage with a `max_methods` value (the world-splitting threshold) greater than the default. This was a workaround for the unnecessarily large number of methods of `eltype(::Type{<:Tuple})`. The `max_methods` value was increased in PR JuliaLang#48322 to help effect inference. Reduce the number of `eltype(::Type{<:Tuple})` methods, which then also allows keeping the `max_methods` for `eltype` at the default value. The intent here is to guard against unnecessary invalidation of the sysimage or other precompiled code, which might require decreasing the `max_methods` value to the natural minimum for many interface functions, by which I mean "generic function meant to have methods added to it by package authors". I intend to approach this issue in following PRs. See also: PR JuliaLang#57884. Regarding future work: I consider the "natural minimum" value for interface functions taking types to be **two**, because the bottom type subtypes each type. If the interface function doesn't accept types, the natural minimum should be **one**.
600869c
to
2e32141
Compare
…rely_on_world_splitting_less
I call callables that are meant to have methods added to by package authors "interface callables". Test that various interface callables are well-behaved in case of the introduction of a new applicable type. Only interface callables taking a single type argument are tested. The specific properties tested: * `max_methods` is high enough for good inference * the number of matching methods for a new type is not excessive The primary motivation for this change is to make any future lowering of the `max_methods` setting of the interface callables safer. To make the tests pass, fix a recent regression in base/strings/search.jl. This change depends on PR JuliaLang#58788 for `eltype`.
Bump. Other potential changes depend on this change, |
I call callables that are meant to have methods added to by package authors "interface callables". Test that various interface callables are well-behaved in case of the introduction of a new applicable type. Only interface callables taking a single type argument are tested. The specific properties tested: * `max_methods` is high enough for good inference * the number of matching methods for a new type is not excessive The primary motivation for this change is to make any future lowering of the `max_methods` setting of the interface callables safer. To make the tests pass, fix a recent regression in base/strings/search.jl. This change depends on PR JuliaLang#58788 for `eltype`.
I call callables that are meant to have methods added to by package authors "interface callables". Test that various interface callables are well-behaved in case of the introduction of a new applicable type. Only interface callables taking a single type argument are tested. The specific properties tested: * `max_methods` is high enough for good inference * the number of matching methods for a new type is not excessive The primary motivation for this change is to make any future lowering of the `max_methods` setting of the interface callables safer. To make the tests pass, fix a recent regression in base/strings/search.jl. This change depends on PR JuliaLang#58788 for `eltype`.
…rely_on_world_splitting_less
…rely_on_world_splitting_less
Bump. I have to note most text I wrote here on the PR discussion is only motivationally relevant for this PR. So, if you want to review, it's not really necessary to read. Also, I see Jeff Bezanson gave a thumbs-up, for what it's worth. |
The
eltype
function was one of the few functions in the sysimage with amax_methods
value (the world-splitting threshold) greater than the default. This was a workaround for the unnecessarily large number of methods ofeltype(::Type{<:Tuple})
. Themax_methods
value was increased in PR #48322 to help effect inference.Reduce the number of
eltype(::Type{<:Tuple})
methods, which then also allows keeping themax_methods
foreltype
at the default value.The intent here is to guard against unnecessary invalidation of the sysimage or other precompiled code, which might require decreasing the
max_methods
value to the natural minimum for many interface functions, by which I mean "generic function meant to have methods added to it by package authors". I intend to approach this issue in following PRs. See also: PR #57884.Regarding future work: I consider the "natural minimum" value for interface functions taking types to be two, because the bottom type subtypes each type. If the interface function doesn't accept types, the natural minimum should be one.