Add AllowInternalUnstable enum to avoid Arc clones for static desugaring feature lists - #162969
spastorino wants to merge 3 commits into
Conversation
…ing feature lists
aa3da6b to
f9410db
Compare
|
@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.
Add AllowInternalUnstable enum to avoid Arc clones for static desugaring feature lists
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (f9f1546): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression 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 -0.0%, secondary -0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 3.2%, secondary -0.5%)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: 498.333s -> 500.939s (0.52%) |
|
TBH I don't think this is worth it? If it improved performance, then yes. But without a perf improvement it's just a bit more complexity and code for no real gain. |
|
This was originally an experiment, not very important and we can close it. My reasoning was different I feel the code is better in the sense that we were using an Arc in a very artificial way when what we really needed was a way to split between statically created lists of strs and dynamic ones. What the new enum does is just introducing this idea. I was more on the side of, if this doesn’t make perf worse is probably worth merging. |
|
Sometimes a struct contains a This case feels similar, except that it requires defining a new type instead of reaching for something that already exists in |
|
Hold on, maybe I did not understand what you meant but the payload of Cow would be [Symbol], which would work great when borrowing and would be quite similar to my |
|
Sorry for the confusion. I mentioned Likewise, in this case, I think |
This comment has been minimized.
This comment has been minimized.
|
I've pushed a quick and dirty change to Cow, for the sake of trying perf over it. I don't like the idea too much and I'm not sure if our test cases would cover potential perf regressions but we would be cloning Vecs now instead of Arcs which won't be cheap. @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.
Add AllowInternalUnstable enum to avoid Arc clones for static desugaring feature lists
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (6e868e7): 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 3.5%, secondary -1.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 7.7%, secondary 4.2%)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: 489.957s -> 490.077s (0.02%) |
|
@nnethercote I'd leave this up to you, I can squash commits and have this ready to be merged. I still prefer my original version as we clone arcs instead of vecs. Perf is not showing bad things but I'm quite sure that we are not exercising the bad paths. We would need macro heavy and cross crate heavy to exercise a bunch of vec clone calls. As Decodable for Cow yields Cow::Owned. |
|
I really caused confusion by mentioning Did you see my comment above? That's where I tried to clarify what I was talking about. |
|
I see, yeah using Cow didn't make sense to me. |
View all comments
This is exploratory followup of #162747
There are upsides and downsides of this. In particular, the bad part is that we grow
ExpnDatasize by 8 bytes. The rest I think is way better this way.Maybe we can do a perf run and see if it make things worse and decide.
r? @nnethercote