Skip to content

Conversation

@timholy
Copy link
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.

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
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.)

Co-authored-by: Jameson Nash <vtjnash@gmail.com>
@vtjnash vtjnash added the 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 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 <vtjnash@gmail.com>
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 <vtjnash@gmail.com>
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