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 array_subpadding slightly #48136

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

jakobnissen
Copy link
Contributor

This should be slightly more efficient as the compiler now only tries to call iterate on t and s once, and will not try to destructure the result if the iterate call returns nothing.
This change reduce spurious JET warnings.

This should be slightly more efficient as the compiler now only tries to call
`iterate` on `t` and `s` once, and will not try to destructure the result if
the `iterate` call returns `nothing`.
This change reduce spurious JET warnings.
checked_size = 0
ps, sstate = iterate(s) # use of Stateful harms inference and makes this vulnerable to invalidation
pad, tstate = iterate(t)
# use of Stateful harms inference and makes this vulnerable to invalidation
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

This does not seem to use Stateful, but just the normal iterate algorithm?

Suggested change
# use of Stateful harms inference and makes this vulnerable to invalidation

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I guess it was written with Stateful before and got changed to not use it and this is here as a hint for future developers to not put that back?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct - it was changed some time before 1.9 by Tim Holy in hunt of invalidations. I left the comment.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

@aviatesk aviatesk added the merge me PR is reviewed. Merge when all tests are passing label Jan 6, 2023
@aviatesk
Copy link
Sponsor Member

aviatesk commented Jan 6, 2023

Test failures are unrelated.

@aviatesk aviatesk merged commit f056c34 into JuliaLang:master Jan 6, 2023
@giordano giordano removed the merge me PR is reviewed. Merge when all tests are passing label Jan 6, 2023
@jakobnissen jakobnissen deleted the typestab branch January 6, 2023 12:49
@aviatesk aviatesk mentioned this pull request May 25, 2023
51 tasks
aviatesk pushed a commit that referenced this pull request May 25, 2023
This should be slightly more efficient as the compiler now only tries to call
`iterate` on `t` and `s` once, and will not try to destructure the result if
the `iterate` call returns `nothing`.
This change reduce spurious JET warnings.
KristofferC pushed a commit that referenced this pull request May 27, 2023
This should be slightly more efficient as the compiler now only tries to call
`iterate` on `t` and `s` once, and will not try to destructure the result if
the `iterate` call returns `nothing`.
This change reduce spurious JET warnings.
kpamnany pushed a commit that referenced this pull request Jun 21, 2023
This should be slightly more efficient as the compiler now only tries to call
`iterate` on `t` and `s` once, and will not try to destructure the result if
the `iterate` call returns `nothing`.
This change reduce spurious JET warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants