Skip to content
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

Suppressed Performance Critical method still marked as Performance Critical #1248

Closed
StefanJanssen95 opened this issue Jul 13, 2019 · 1 comment
Assignees
Milestone

Comments

@StefanJanssen95
Copy link

When a certain method is marked as PerformanceCritical all functions calling that are also marked PerformanceCritical. during debugging I want to log information so I made a method that can do that for me. Unfortunately if I suppress the warning on that method, methods which call the suppressed method are marked as PerformanceCritical.
This hides possible other PerformanceCritical parts since every method in my class will call the the PerformanceCritical method.

I have the following piece of code

[SuppressMessage("ReSharper", "Unity.PerformanceCriticalCodeInvocation")]
private void LogInfo(string val)
{
    if (enableDebugLog)
        Debug.Log(val);
}

This seems to me like unwanted behavior since suppressing the warning should actually suppress the warning on the method itself.

@StefanJanssen95 StefanJanssen95 changed the title Performance Critical method ignored still marked as Performance Critical Suppressed Performance Critical method still marked as Performance Critical Jul 13, 2019
@Domonion Domonion self-assigned this Aug 30, 2020
@Domonion
Copy link

Domonion commented Oct 20, 2020

Hello @StefanJanssen95! From the next EAP, you will be able to add // ReSharper disable Unity.PerformanceAnalysis comment to remove undesired methods from Performance analysis:
java_Y6M5E8mzAe

This is available as Quick Fix at any marked invocation:
quickFix

As Code Vision item:
contaxtAction

And Context Action at method name:
codeVision

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

No branches or pull requests

2 participants