Skip to content

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

Merged
merged 4 commits into from
Jan 21, 2020
Merged

Conversation

krasnotsvetov
Copy link
Collaborator

@krasnotsvetov krasnotsvetov commented Dec 13, 2019

  1. Extensibility for performance analyzers
  2. Rewrite current performance analyzer to new logic (remove separate performance unity stage and move logic to common unity stage)
  3. Do not mark the method as expensive only if null comparison with unity object is used
  4. Show performance analysis for known methods without waiting for SWA
  5. Move multiplication order inspection to performance analysis + new inefficient multidimensional array usage inspection
  6. Update tests

Copy link
Member

@citizenmatt citizenmatt left a 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)
Copy link
Member

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?


// 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;
Copy link
Member

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?

@krasnotsvetov krasnotsvetov changed the title Prefer jagged arrays instead of multidimensional arrays inspection Perfomance analysis refacotring Jan 17, 2020
@krasnotsvetov krasnotsvetov changed the title Perfomance analysis refacotring Perfomance analysis refactoring Jan 17, 2020
Copy link
Member

@citizenmatt citizenmatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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
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

Successfully merging this pull request may close these issues.

2 participants