Repository navigation
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
exhaustiveness: filter matrix rows while splitting ctors
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (70023ca): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 2.8%, secondary 0.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 1.1%, secondary -9.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 462.15s -> 461.074s (-0.23%) |
|
I asked an LLM to investigate the one perf regression; it seems entirely unrelated to this PR. Namely: the regression is fully explained by the |
|
Yes, I looked at the cachegrind diff locally and I think the regression unrelated. |
This comment has been minimized.
This comment has been minimized.
d6c3914 to
5a37fb2
Compare
|
Also, some of the |
|
I had an LLM look at this, and it found the following issues (although I'm unsure how important they are). It also found that this PR fixes a previously-unknown ICE: #166738. 1.
|
|
Huh ok, so the ids of opaques was useful after all 🤔 That's 1 and 2. 3 I'll ignore because that's just a difference in stack usage (the logic was recursive and still is, nothing changed here). Can you try case 4 with #166703 to see if the regression is still there? |
|
@Nadrieril Case 4 still has a performance regression with #166703. A |
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
|
Oh, for 4 the regression is actually because of the floats! That test is cleverly engineered so that normal exhaustiveness doesn't hit a float quadratic case, but the lint now does. I'll ignore: the lint is unstable, and this would require someone figuring out a way to partition float ranges into disjoint subranges which I don't want to attempt. |
75ece38 to
f1f7112
Compare
This comment has been minimized.
This comment has been minimized.
f1f7112 to
780fc22
Compare
This comment has been minimized.
This comment has been minimized.
780fc22 to
725257e
Compare
That's an idea I'd had for a long time but never thought would be worth it. Then #166637 came along, with a reminder that yes people do write immense match statements.
Before this PR, once we've figured out a minimal set of constructors to use to analyze the matrix, we'd iterate through the whole matrix to find which rows correspond to the current constructor. That's somewhat redundant with the splitting analysis that already went through all the row constructors. This PR combines the two in one: now constructor splitting also returns the filtered row indices for each split constructor.
This removes the by-construction quadratic behavior of exhaustiveness for mostly disjoint arms. I did leave quadratic behavior for slice patterns and integer ranges for simplicity, which we can fix later if we want.
r? dianne
LLM disclosure: handcrafted with love. No LLMs were involved at any stage in the making of this PR. I did use an LLM to throw down #166656 quickly with the basic idea to see if perf would be worth the effort. No code or idea from that PR made it into this one that didn't already come from me.