-
Notifications
You must be signed in to change notification settings - Fork 240
micro opt: stop emitting __internal_config_statement from test attr #3826
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
base: master
Are you sure you want to change the base?
Conversation
6e03d13 to
a0d58c9
Compare
| if snforge_std::_internals::is_config_run() { | ||
| #if_content | ||
|
|
||
| return; |
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 think we should be able to do the same in fuzzer wrapper in wrapper.rs file.
Replace appending #[#internal_config_attr] there with simply creating an another if branch like you did here.
Then we could get rid of the internal config statement attribute entirely.
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.
cc @ddoktorski @franciszekjob please check if I'm not making things up
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.
Yup, I think that should be possible to do
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.
@cptartur This sounds like a good refactoring idea, but tbh I don't think this matters at all apart from code cleanliness - you would normally expect a lot more test attrs than any other.
Especially as I would need to have some equivalent of
| pub fn get_statements(db: &dyn SyntaxGroup, func: &FunctionWithBody) -> (String, String) { |
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.
We can do that refactor at a later date then.
| if snforge_std::_internals::is_config_run() { | ||
| #if_content | ||
|
|
||
| return; |
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.
Yup, I think that should be possible to do
The test attr is a hot path, so it may make sense to avoid forcing the expansion to happen twice for every test. The time penalty is not big, but seems easy enough to avoid.
Events breakdown for OZ before / after: