-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Refactor Binder
to track bound vars
#76814
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 4f957e472bde079b127908ca8994e5259654e161 with merge e3ccacbe714c3e189a4895651ada1f854960ddf8... |
☀️ Try build successful - checks-actions, checks-azure |
Queued e3ccacbe714c3e189a4895651ada1f854960ddf8 with parent 285fc7d, future comparison URL. |
Finished benchmarking try commit (e3ccacbe714c3e189a4895651ada1f854960ddf8): 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 |
Lol, you should have seen some of the NRVO attempts: #71003 (comment) |
90f8e48
to
2ed8114
Compare
2ed8114
to
3172ff5
Compare
I've rebased this on master, and these changes might change perf, so want to retest that. |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 3172ff568d95d27daa25e4d3c20ae3a7ea412358 with merge 13c48570199b4edabb385cc99e6e2a986b1ba938... |
☀️ Try build successful - checks-actions, checks-azure |
Queued 13c48570199b4edabb385cc99e6e2a986b1ba938 with parent cbc42a0, future comparison URL. |
@camelid this PR isn't related to compile time |
Oh it isn't? Sorry about that :) Why are you doing a perf run then? |
@jackh726 FYI you can modify labels yourself with |
@camelid this is a feature that may have a perf impact, as opposed to a PR that's only for reducing compile time. |
Ah, makes sense. Thanks :) |
Finished benchmarking try commit (13c48570199b4edabb385cc99e6e2a986b1ba938): 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 |
☀️ Test successful - checks-actions |
@jackh726 @nikomatsakis this change caused a moderate performance regression which seems to be directly related to the changes made. I see the last performance run was never really discussed before this was merged. Is there something we can do to address the performance regressions? This is not severe enough to warrant discussions of reverting the changes, but the regression is severe enough that it should be addressed. |
So, first, this PR is important longer term in order enable the Chalk integration (without expensive conversions).
Ultimately though, the performance regression here is unavoidable in the short-term. We do strictly more work because we have to track bound vars. Furthermore, I didn't spend a bunch of effort pursuing specific optimizations (maybe there's a clever way to revert the size increase, for example) since that would be out of scope here. |
Do you think this would be approachable enough for a newcomer to the trait system like me? |
@camelid there's one way to find out ;) |
@camelid I think almost all of them should be fairly easy |
I managed to be able to remove all but one I think, in testing |
Each call seems to look like |
|
See [1] for motivation. In one place, it manually uses the `BoundVarsCollector` for now because we don't know what the bound variables are, and adding support for tracking the bound variables will probably be a tricky change. [1]: rust-lang#76814 (comment)
c.c. @rust-lang/wg-traits
This is super early (and might just get closed at some point), but want to get at least an initial idea of the perf impact.
r? @ghost