-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Try to make ObligationForest more efficient #77908
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit b23fdd325dfe20c9ccc0dff4197c40cf6a2952eb with merge b26b61d0fd2de6070a1e622018568765eae31abb... |
Didn't notice the failing CI, the try build is going to fail. |
The CI fails because the tests don't compile, I don't know if perf requires that. Working on it :) |
@petrochenkov should be good now. |
@bors try |
⌛ Trying commit 853756a9d69bbed097b29a3b1b7147883750c624 with merge 6ac291c1bb097b0dfcfc216f6387b7e4cb80c38e... |
☀️ Try build successful - checks-actions, checks-azure |
Queued 6ac291c1bb097b0dfcfc216f6387b7e4cb80c38e with parent adef9da, future comparison URL. |
Finished benchmarking try commit (6ac291c1bb097b0dfcfc216f6387b7e4cb80c38e): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
Can I request another perf run, please? I'm not entirely sure about the previous run, but I don't have any better guess than the change where I replaced a Vec of errors to a closure. I have reverted this change. |
@bors try @rust-timer queue FYI, a lot of effort went into benchmarking and performance-tuning this code in the past, see the git history for obligation forest, commits by nnethercote in particular. |
Awaiting bors try build completion |
⌛ Trying commit 0bf5cbd06c3c8cc42d555f37c81e59358097bb17 with merge e6a746c02317eef2240ba530ecedd948da7d7d50... |
@petrochenkov thanks! I'm not trying to claim that I can do better in a day, I don't plan on pushing this further if the results aren't good enough. But seeing the results can be an educational experience for sure. |
☀️ Try build successful - checks-actions, checks-azure |
Queued e6a746c02317eef2240ba530ecedd948da7d7d50 with parent 5565241, future comparison URL. |
Just in case you didn't notice already, there's also another big PR open to improve perf for Obligation Forest. #69218 |
Finished benchmarking try commit (e6a746c02317eef2240ba530ecedd948da7d7d50): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
That looks better 😅 |
I'm not familiar with obligation forest, but people who are familiar are mostly unavailable, so I'll try to review this during the weekend, the changes don't look too invasive. |
@petrochenkov Thanks! With the last force push I've removed a commit-revert pair that doesn't need to be there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look ok to me. This will interfere with #69218, but that PR is in a very uncertain state so I think it's reasonable to go forward with these concrete improvements.
@bugadani: How did you find these improvements? Did you use a profiler, and if so, which one? I'm alway curious to learn how other people find optimizations :)
@nnethercote in this case this was complete guesswork. I was looking a piece of related code somewhere, wanted to understand what it does, and stumbled upon the comments in OF mentioning the code is hot. From there, I went on looking if the implementation does work it doesn't necessarily have to. In this case, this boiled down to "no allocation is the fastest type of allocation". Of course, this approach has two downsides:
There still are some unnecessary |
@bors r+ |
📌 Commit 8c7a8a6 has been approved by |
🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened |
⌛ Testing commit 8c7a8a6 with merge 4d223ce55315a94f18f16c53e665b64082c3025b... |
@bors treeclosed=1000 Need to fix another thing in the bors setup. |
@bors treeclosed- retry |
☀️ Test successful - checks-actions, checks-azure |
Final results are as expected. |
This PR tries to decrease the number of allocations in ObligationForest, as well as moves some cold path code to an uninlined function.