-
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
add note about remove_duplicate_unreachable_blocks
in source comments
#110658
Conversation
…r perf with `SmallVec`s
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
I don't think we usually comment about failed perf attempts, since I would assume very hot code (e.g. trait selection) would be riddled with these comments -- though perhaps someone like @nnethercote knows about best practice here. |
// Note: Trying to Turn `duplicates` into a `SmallVec` for performance did not bear fruit, see | ||
// https://github.com/rust-lang/rust/pull/110524 |
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.
Even if we do want to leave a note about perf sensitivity here, it should probably left as a comment on the field instead?
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.
I agree.
That sounds reasonable - I'm open to whatever maintainers feel is best. |
Comments about perf are good when the code has unexpected things in it. E.g. often code that is optimized is written in a way that is different to the obvious way, and a comment about that is helpful: "this code is hot, hence...". This PR's comment is effectively saying "this code is written in the obvious way, not an optimized way". And @compiler-errors is right that we don't normally write comments like that. If there were many of them I think they'd get annoying. If there was a reason to think that this code would be especially hot, then maybe, but it doesn't strike me that way. |
I just thought that it'd be quite likely that someone in the future might see this and see an opportunity to optimize. Only to waste their time. But if you think it's not worth it, fair. |
Switching to waiting on author, IIUC indications were left for some changes? thanks @rustbot author |
I'm gonna close this since it doesn't seem like adding this note is useful. Thanks for the PR! |
gotta write down negative results, for science!
@Nilstrieb
#110524 (comment)
Please signal for rollup.