-
-
Couldn't load subscription status.
- Fork 5.7k
eliminate some nongeneric methods of length and size
#59442
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
Merged
oscardssmith
merged 2 commits into
JuliaLang:master
from
nsajko:eliminate_some_Array-specific_methods_of_size
Sep 27, 2025
Merged
eliminate some nongeneric methods of length and size
#59442
oscardssmith
merged 2 commits into
JuliaLang:master
from
nsajko:eliminate_some_Array-specific_methods_of_size
Sep 27, 2025
Conversation
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
6296bd7 to
b1717b7
Compare
nsajko
commented
Aug 30, 2025
jishnub
pushed a commit
to JuliaLang/LinearAlgebra.jl
that referenced
this pull request
Sep 1, 2025
…#1431) An issue with `Base` is that some methods of `size` throw `BoundsError` for an out-of-bounds second argument, while others throw `ErrorException` in the same case. Relax the tests here to allow for fixing that issue in `Base` in the future. PR that depends on this change: * JuliaLang/julia#59442
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 2, 2025
Specifically I want this because of PR JuliaLang/LinearAlgebra.jl#1431, which PR JuliaLang#59442 depends on.
b898d22 to
db42652
Compare
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 2, 2025
The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442. These seems like they might potentially cause regressions
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 2, 2025
The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442.
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 2, 2025
Specifically I want this because of PR JuliaLang/LinearAlgebra.jl#1431, which PR JuliaLang#59442 depends on.
cd6182e to
f60ab17
Compare
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 3, 2025
Specifically I want this because of PR JuliaLang/LinearAlgebra.jl#1431, which PR JuliaLang#59442 depends on. (cherry picked from commit 54f21dd3217e6c481eb37d82a9506f76c6d8c92c)
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 3, 2025
The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442. (cherry picked from commit 16d504108c6d69abf7fb8e175e61132314e3a49a)
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 3, 2025
The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442. Another thing that is necessary for preserving good abstract inference is to convert the index to `Int` before using it. This is correct it there can't be more than `typemax(Int)` dimensions anyway.
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 3, 2025
Specifically I want this because of PR JuliaLang/LinearAlgebra.jl#1431, which PR JuliaLang#59442 depends on. (cherry picked from PR JuliaLang#59464)
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 3, 2025
The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442. Another thing that is necessary for preserving good abstract inference is to convert the index to `Int` before using it. This is correct it there can't be more than `typemax(Int)` dimensions anyway. (cherry picked from PR JuliaLang#59465)
f60ab17 to
7555dd4
Compare
ViralBShah
pushed a commit
that referenced
this pull request
Sep 3, 2025
Specifically I want this because of PR JuliaLang/LinearAlgebra.jl#1431, which PR #59442 depends on.
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 3, 2025
The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442. Another thing that is necessary for preserving good abstract inference is to convert the index to `Int` before using it. This is correct it there can't be more than `typemax(Int)` dimensions anyway. (cherry picked from PR JuliaLang#59465)
7555dd4 to
d3ab3f1
Compare
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 3, 2025
The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442. Another thing that is necessary for preserving good abstract inference is to convert the index to `Int` before using it. This is correct it there can't be more than `typemax(Int)` dimensions anyway. (cherry picked from PR JuliaLang#59465)
e5ff23c to
6ea17fb
Compare
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 3, 2025
The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442. Another thing that is necessary for preserving good abstract inference is to convert the index to `Int` before using it. This is correct it there can't be more than `typemax(Int)` dimensions anyway.
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 3, 2025
The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442. Another thing that is necessary for preserving good abstract inference is to convert the index to `Int` before using it. This is correct it there can't be more than `typemax(Int)` dimensions anyway. (cherry picked from PR JuliaLang#59465)
6ea17fb to
cea09b4
Compare
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 3, 2025
The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442. Another thing that is necessary for preserving good abstract inference is to convert the index to `Int` before using it. This is correct it there can't be more than `typemax(Int)` dimensions anyway. (cherry picked from PR JuliaLang#59465)
cea09b4 to
2565bed
Compare
nsajko
added a commit
to nsajko/julia
that referenced
this pull request
Sep 9, 2025
The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442. Another thing that is necessary for preserving good abstract inference is to convert the index to `Int` before using it. This is correct it there can't be more than `typemax(Int)` dimensions anyway.
oscardssmith
pushed a commit
to nsajko/julia
that referenced
this pull request
Sep 23, 2025
The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442. Another thing that is necessary for preserving good abstract inference is to convert the index to `Int` before using it. This is correct it there can't be more than `typemax(Int)` dimensions anyway.
vtjnash
pushed a commit
that referenced
this pull request
Sep 26, 2025
…rt (#59465) The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR #59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR #59442. Another thing that is necessary for preserving good abstract inference is to convert the index argument to `Int` before using it. This is correct as there can't be more than `typemax(Int)` dimensions anyway (the `N` type parameter to `AbstractArray` is an `Int` value).
2565bed to
66fe55a
Compare
oscardssmith
approved these changes
Sep 27, 2025
xal-0
pushed a commit
to xal-0/julia
that referenced
this pull request
Sep 30, 2025
…rt (JuliaLang#59465) The generic method `size(::AbstractArray, ::Any)` currently has: * method static parameters * an abstract type assert (`::Integer`) in the method body PR JuliaLang#59442 aims to make this generic method be used for `Array` and `Memory`, by deleting the more specific methods. It is my understanding that method static parameters and abstract type asserts can cause performance issues, when they're not optimized out, which happens when the argument types are not concretely inferred. So I'm putting up this PR, which eliminates the method static parameters and the `typeassert`, to prevent any possible regressions from PR JuliaLang#59442. Another thing that is necessary for preserving good abstract inference is to convert the index argument to `Int` before using it. This is correct as there can't be more than `typemax(Int)` dimensions anyway (the `N` type parameter to `AbstractArray` is an `Int` value).
xal-0
pushed a commit
to xal-0/julia
that referenced
this pull request
Sep 30, 2025
…9442) Changes: * Eliminate some nongeneric `length` methods: * `GenericMemory` * `Slice` * `IdentityUnitRange` * `CartesianIndices` * `LogicalIndex` * `CodeUnits` * `UnsafeView` (from the `Random` stdlib) * Eliminate some nongeneric two-argument `size` methods: * `GenericMemory` * `Array` * `BitVector` Depends on PR JuliaLang#59465 to prevent abstract inference regressions.
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.
Changes:
Eliminate some nongeneric
lengthmethods:GenericMemorySliceIdentityUnitRangeCartesianIndicesLogicalIndexCodeUnitsUnsafeView(from theRandomstdlib)Eliminate some nongeneric two-argument
sizemethods:GenericMemoryArrayBitVectorDepends on PR #59465 to prevent abstract inference regressions.