Skip to content
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

RCS1231 can cause perf implications and should probably be avoided in most scenarios when the struct is small #1499

Open
prezaei opened this issue Aug 11, 2024 · 5 comments

Comments

@prezaei
Copy link

prezaei commented Aug 11, 2024

I wouldn't enable this rule, at least not unless all the readonly structs are massive. It seems like the intent is to avoid costs associated with copying of structs, but passing by reference then means that all accesses are indirections, which has its own costs.

@prezaei prezaei changed the title RCS1231 is can have perf implications and should probably be avoided in most scenarios when the struct is small RCS1231 can cause perf implications and should probably be avoided in most scenarios when the struct is small Aug 11, 2024
@josefpihrt
Copy link
Collaborator

This analyzer is not enabled by default.

@prezaei
Copy link
Author

prezaei commented Aug 13, 2024

This analyzer is not enabled by default.

Correct. But is it even safe to enable?

@josefpihrt
Copy link
Collaborator

So you are suggesting to simply remove it completely. Ok, but generally it could be a problem because it's a breaking change. Some can then complain that it was removed.

@prezaei
Copy link
Author

prezaei commented Aug 14, 2024

So you are suggesting to simply remove it completely. Ok, but generally it could be a problem because it's a breaking change. Some can then complain that it was removed.

Thank you. Yes, I was proposing that it should be deprecated. I believe you have other deprecated rules already.

Btw, I absolutely love what you have done with this library. Simply put: it is a work of art. Thank you

@josefpihrt
Copy link
Collaborator

Btw, I absolutely love what you have done with this library. Simply put: it is a work of art. Thank you

Thank you very much! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants