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

Inferrability: eliminate more Core.Box #44029

Merged
merged 4 commits into from
Feb 4, 2022
Merged

Inferrability: eliminate more Core.Box #44029

merged 4 commits into from
Feb 4, 2022

Conversation

timholy
Copy link
Sponsor Member

@timholy timholy commented Feb 3, 2022

These stem from #15276, i.e., captured variables.
They were identified by scanning all compiled MethodInstances with
hasbox in the newly-released MethodAnalysis 0.4.5.

Core.Box often causes "follow-on" inference problems,
but for these cases there were relatively few, which may be why
these didn't show up earlier during the Great Invalidation Hunt.
Still, there doesn't seem to be any particular reason not to fix them.

This doesn't eliminate all Core.Box cases from Base, but only a
handful remain. The most common remaining case stems from inner
functions calling themselves.

base/weakkeydict.jl Outdated Show resolved Hide resolved
These stem from julia#15276, i.e.,
https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-captured
They were identified by scanning all compiled MethodInstances with
hasbox in the newly-released MethodAnalysis 0.4.5.

Core.Box often causes "follow-on" inference problems,
but for these cases there were relatively few, which may be why
these didn't show up earlier during the Great Invalidation Hunt.
Still, there doesn't seem to be any particular reason not to fix them.

This doesn't eliminate all Core.Box cases from Base, but only a
handful remain. The most common remaining case stems from inner
functions calling themselves.
@timholy
Copy link
Sponsor Member Author

timholy commented Feb 3, 2022

I threw in a couple of annotations that eliminate a very small number of Test invalidations as well. (The whole module is @nospecialize.)

base/weakkeydict.jl Outdated Show resolved Hide resolved
Co-authored-by: Jameson Nash <[email protected]>
stdlib/REPL/src/LineEdit.jl Outdated Show resolved Hide resolved
@vtjnash vtjnash added the status:merge me PR is reviewed. Merge when all tests are passing label Feb 4, 2022
@timholy timholy merged commit 46032c5 into master Feb 4, 2022
@timholy timholy deleted the teh/core_box branch February 4, 2022 20:16
@DilumAluthge DilumAluthge removed the status:merge me PR is reviewed. Merge when all tests are passing label Feb 7, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
These stem from julia#15276, i.e.,
https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-captured
They were identified by scanning all compiled MethodInstances with
hasbox in the newly-released MethodAnalysis 0.4.5.

Core.Box often causes "follow-on" inference problems,
but for these cases there were relatively few, which may be why
these didn't show up earlier during the Great Invalidation Hunt.
Still, there doesn't seem to be any particular reason not to fix them.

This doesn't eliminate all Core.Box cases from Base, but only a
handful remain. The most common remaining case stems from inner
functions calling themselves.

It also prevents a couple of Test invalidations

Co-authored-by: Jameson Nash <[email protected]>
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
These stem from julia#15276, i.e.,
https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-captured
They were identified by scanning all compiled MethodInstances with
hasbox in the newly-released MethodAnalysis 0.4.5.

Core.Box often causes "follow-on" inference problems,
but for these cases there were relatively few, which may be why
these didn't show up earlier during the Great Invalidation Hunt.
Still, there doesn't seem to be any particular reason not to fix them.

This doesn't eliminate all Core.Box cases from Base, but only a
handful remain. The most common remaining case stems from inner
functions calling themselves.

It also prevents a couple of Test invalidations

Co-authored-by: Jameson Nash <[email protected]>
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.

None yet

5 participants