-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
some inlining cost model updates #35235
Conversation
These seem like they should also be even higher cost, since if they're still present, that means we couldn't constant fold them. And we should do nanosoldier, even if just to know which benchmarks will be affected after merging. |
My hope was that would be covered by looking at the argument types; with abstract types they will generally be pretty expensive, concrete types not constant-folded might be expensive but might be in-between, e.g. |
Those also may be just a pointer comparison. Okay, makes sense this is handled by the abstract type cost. |
These all look fine to me. In the longer run, should we consider trying to tune these numbers? Maybe even to the user's specific CPU? |
Oops, I messed up the type check here. |
This also fixes the following inlining bug:
All in all, I was hoping this PR would make us do less inlining, but I think it's going to end up just moving things around and improving the decisions, not necessarily doing more or less overall. |
a4b3126
to
c4b5b79
Compare
Ok I think this is ready to go. Will run benchmarks if CI passes. |
c4b5b79
to
d9e6cca
Compare
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
The regressions in Random are due to inlining being rearranged in an unlucky way that prevents us from removing an allocation we used to remove, the
Looking through it, the new inlining decisions seem totally reasonable, it's just that they're not able to take this into account. So we may want to revisit this after #34126, which should make argument passing cost more uniform. |
d9e6cca
to
05dfb5c
Compare
05dfb5c
to
88ebed3
Compare
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
That looks quite positive! @nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
bump? |
- treat arrayset like arrayref - add small cost for sizeof, nfields, isa, subtype
88ebed3
to
18e19cd
Compare
@nanosoldier |
I rebased this, and after some experiments decided to pare it down to some minimal changes. The other changes seemed to make some things a bit slower. |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @christopher-dG |
Looks pretty good, some things that might be worth looking at:
|
I'm still happy with this. @JeffBezanson merge? In the array cat example above, it is a moderately complex function which shouldn't usually need inlining. However, |
- treat arrayset like arrayref - add small cost for typeof
- treat arrayset like arrayref - add small cost for typeof
In the spirit of #31455. I tried to keep this quite conservative and unlikely to affect high-performance code. If everyone thinks this looks reasonable I'll run benchmarks.
Some quick stats:
Before:
After: