-
Notifications
You must be signed in to change notification settings - Fork 140
Perfomance analysis refactoring #1459
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
Conversation
resharper/resharper-unity/src/CSharp/Daemon/Errors/CSharpErrors.xml
Outdated
Show resolved
Hide resolved
resharper/resharper-unity/src/CSharp/Daemon/Errors/CSharpErrors.xml
Outdated
Show resolved
Hide resolved
...-unity/src/CSharp/Daemon/Stages/Analysis/MultidimensionalArraysDeclarationProblemAnalyzer.cs
Outdated
Show resolved
Hide resolved
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.
- The availability tests aren't showing the warning?
- This feels very much like a micro-optimisation - do we want to add a warning to every multidimensional array declaration, or should this just be for arrays that are accessed in performance critical context, with the access highlighted as expensive?
- We need more tests for higher ranks of multidimensional arrays. Probably also any other variation of initialisation or access - will it convert expressions, etc.
- We absolutely need a "Why is Rider suggesting this?" page for this one
} | ||
|
||
// Rare case, ignore it | ||
if (multipleDeclaration == null || multipleDeclaration.Declarators.Count > 1) |
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.
Why is this a rare case? Does it include the example of int foo[1,3], bar[2,2]
? Shouldn't that be handled too?
...-unity/src/CSharp/Daemon/Stages/Analysis/MultidimensionalArraysDeclarationProblemAnalyzer.cs
Outdated
Show resolved
Hide resolved
|
||
// Don't know where we should insert array initialization (constructor?, which constructor if there are several constructors?) | ||
if (usages.Count > 0 && element is IFieldDeclaration && arrayCreationExpression?.ArrayInitializer == null) | ||
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.
Add the warning, but don't show the quick fix?
...nity/src/CSharp/Feature/Services/QuickFixes/InefficientMultidimensionalArrayUsageQuickFix.cs
Show resolved
Hide resolved
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.
LGTM
...sharper-unity/src/CSharp/Feature/Services/Explanatory/UnityCodeInspectionWikiDataProvider.cs
Show resolved
Hide resolved
...rper/resharper-unity/src/CSharp/Daemon/Stages/Highlightings/UnityHighlightingAttributeIds.cs
Show resolved
Hide resolved
...test/data/CSharp/Daemon/Stages/PerformanceCriticalCodeAnalysis/resharper/SimpleTest2.cs.gold
Show resolved
Hide resolved
...ity/test/data/CSharp/Daemon/Stages/PerformanceCriticalCodeAnalysis/rider/SimpleTest2.cs.gold
Show resolved
Hide resolved
2. Rewrite current performance analyzer to new logic (remove seperate perfomance unity stage and move logic to common unity stage) 3. Do not mark method as expensive only if null comparison with unity object is used 4. Move mul order analysis to perfomance analysis 5. Improve and move multidim arrays usage analysis to perfomance analysis
2. Update tests/return ignored tests
890f5f0
to
080f9cc
Compare
Uh oh!
There was an error while loading. Please reload this page.