-
Notifications
You must be signed in to change notification settings - Fork 231
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
S1450 Improve performance: PrivateFieldUsedAsLocalVariable #4589
Comments
Snippet from original issue, might not be related: Thanks for the feedback. We also suspected that the dictionary might still be somehow connected. We meanwhile changed the huge dictionary to To answer the open question: Yes, integrating 8.23 actually brought the build times down from ~3h to ~2h. Also find a anaonymized and shortened version of the file in question below (in reality its 4200 lines): using System.Collections.Generic;
using System.Linq;
public class InformationContainer
{
public InformationContainer(string identifier, int x, int y)
{
Identifier = identifier;
X = x;
Y = y;
}
public string Identifier { get; }
public int X { get; }
public int Y { get; }
}
public static class LongDictionaryContainer
{
public static IDictionary<string, IList<InformationContainer>> LongDictionary = new Dictionary<string, IList<InformationContainer>>
{
{"1", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"2", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"3", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"4", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"5", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,1) } },
{"6", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"7", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,1), new InformationContainer("Lorem Ipsum", 0,0) } },
{"8", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"9", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"10", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,1), new InformationContainer("Lorem Ipsum", 0,0) } },
{"11", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"12", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"13", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,1), new InformationContainer("Lorem Ipsum", 0,0) } },
{"14", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"15", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"16", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"17", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"18", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"19", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"20", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,1), new InformationContainer("Lorem Ipsum", 0,0) } },
{"21", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"22", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"23", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,1), new InformationContainer("Lorem Ipsum", 0,0) } },
{"24", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,1), new InformationContainer("Lorem Ipsum", 0,0) } },
{"25", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"26", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } },
{"27", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,1), new InformationContainer("Lorem Ipsum", 0,0) } },
{"28", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,1), new InformationContainer("Lorem Ipsum", 0,0) } },
{"29", new List<InformationContainer> { new InformationContainer("Lorem Ipsum", 0,0) } }
};
} Thanks for a great product and the rapid help! One final question from our side: We actually excluded the whole file using If yes, is there a way to exclude certain analyzers for a specific file? |
Might be related to #4350 |
|
It's not clear why is the |
Split of #4483, originally reported by @pfeigl into separate issues per rule:
Description
We have a single assembly which takes very long when beeing analyzed.
/p:reportanalyzer=true
shows the following resultRepro steps
For now I'm unable to share the source code :-( Some things that might stand out and give you some hints:
<Property Name="sonar.exclusions">**/*.xml,**/*.xsd</Property>
Known workarounds
We didn't find one (except ofcourse excluding the whole project, but that shouldn't be an option ;-) )
Related information
The text was updated successfully, but these errors were encountered: