-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Retry failed macro matching for diagnostics #103898
Conversation
This should allow us to collect detailed information without slowing down the inital hot path.
This moves out the matching part of expansion into a new function. This function will try to match the macro and return an error if it failed to match. A tracker can be used to get more information about the matching.
For now, we only collect the small info for the `best_failure`, but using this tracker, we can easily extend it in the future to track things with more performance overhead. We cannot retry cases where the macro failed with a parser error that was emitted already, as that would cause us to emit the same error to the user twice.
These were useful while debugging, so I'll leave them here.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 1e21b3c with merge 77c0eb6b819434c3e06697b4741abf4b7aa968fb... |
☀️ Try build successful - checks-actions |
Queued 77c0eb6b819434c3e06697b4741abf4b7aa968fb with parent edf0182, future comparison URL. |
Finished benchmarking commit (77c0eb6b819434c3e06697b4741abf4b7aa968fb): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
I don't like how this adds complexity to some code that is already very complex. But error messages for declarative macros are pretty bad, so improvement there is welcome. And the html5ever perf wins are nice. So overall I am inclined to accept this once the requested changes are made and questions answered. |
@nnethercote in case you've missed the commit :) |
Yes, sorry, I missed it. @bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (b7b7f27): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. |
Retry failed macro matching for diagnostics When a declarative macro fails to match, retry the matching to collect diagnostic info instead of collecting it on the fly in the hot path. Split out of rust-lang#103439. You made a bunch of changes to declarative macro matching, so r? `@nnethercote` This change should produce a few small perf wins: rust-lang#103439 (comment)
When a declarative macro fails to match, retry the matching to collect diagnostic info instead of collecting it on the fly in the hot path. Split out of #103439.
You made a bunch of changes to declarative macro matching, so
r? @nnethercote
This change should produce a few small perf wins: #103439 (comment)