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

inlining: follow #45272, improve the finalizer inlining implementation #45934

Merged
merged 2 commits into from
Jul 13, 2022

Conversation

aviatesk
Copy link
Sponsor Member

@aviatesk aviatesk commented Jul 5, 2022

  • added more comments to explain the purpose of code
  • properly handle ConstantCase
  • erase Core.finalizer call more aggressively
  • improved type stabilities by handling edge cases
  • renamed AddFianlizerUse to FinalizerUse
  • removed dead pieces of code

@aviatesk
Copy link
Sponsor Member Author

aviatesk commented Jul 7, 2022

@nanosoldier runbenchmarks("inference", vs=":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here.

@aviatesk aviatesk force-pushed the avi/follow-45272 branch 2 times, most recently from 7c49f16 to 352121c Compare July 11, 2022 09:02
Comment on lines +1354 to +1368
# Test that we can inline a finalizer that just returns a constant value
mutable struct DoAllocConst
function DoAllocConst()
finalizer(new()) do this
return nothing
end
end
end
let src = code_typed1() do
for i = 1:1000
DoAllocConst()
end
end
@test count(isnew, src.code) == 0
end
Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

I added some more test cases. They are all working on the master except for this DoAllocConst case, and it's fixed by the second commit.

@aviatesk aviatesk changed the title inlining: follow #45272, improve finalizer inlining robustness inlining: follow #45272, improve the finalizer inlining implementation Jul 12, 2022
@aviatesk
Copy link
Sponsor Member Author

@nanosoldier runbenchmarks("inference", vs=":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - no performance regressions were detected. A full report can be found here.

- added more comments to explain the purpose of code
- properly handle `ConstantCase`
- erase `Core.finalizer` call more aggressively
- improved type stabilities by handling edge cases
- renamed `AddFianlizerUse` to `FinalizerUse`
- removed dead pieces of code
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

2 participants