-
Notifications
You must be signed in to change notification settings - Fork 754
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
remove linq from hot paths #2373
Conversation
Could you give us some numbers of performance increase of this change? |
About Don't understand me wrong, I want that SpecFlow has nullable reference types. I simply had not yet enough time to think about it how to get started with it. |
You only get warnings where you have it enabled. Meaning even if you use a class that has it enabled, you won't get warnings if your class has not enabled it. And if you enable it, you should fix the warning. This is how I usually do it for other projects. This means the whole codebase gets continuesly nullableaware. |
@bollhals The team had a look at this PR and we discussed it internally if we want to merge it. |
I understand your decision. Since maintainability is often subjective, would you be able to shed a bit of light on what you'd consider too big of a decrease and what not? (Simplifies other existing & future PR as well as possibly getting some of the improvements of this PR in another acceptable form) Examples: public bool IsEmpty => !instances.Any(); vs public bool IsEmpty => instances.Count == 0; or tags.Concat(scenarioInfo.Tags).Distinct(); vs private static IEnumerable<string> CombineTags(string[] featureTags, string[] scenarioTags)
{
var result = new HashSet<string>(featureTags);
foreach (string tag in scenarioTags)
{
result.Add(tag);
}
return result;
} or is it the larger size of the code / chaining ifs? |
In this case, it was the amount of new code (from 10 to 50 lines) and the 4 level of ifs. From your examples, the first case is totally fine. The second case would be ok but depends on the usage of it. |
Thanks for the explanation. I'll see what's possible to squeeze out👍🏼 |
This PR contains 2 main changes:
Types of changes
Checklist:
Comments
#nullable enable
to every class, is this fine for you? (see Nullable Reference Types)