Good day
I recently updated my Acuminator and got the error below. I see there is a reduced performance if I don't add this function to my extensions. I was hoping some can explain this a bit better as I do see performance issues where I have a lot(20+) customizations running on one site.
Error PX1016 A graph extension must include a public static IsActive method with the bool return type. Extensions which are constantly active reduce performance. Suppress the error if you need the graph extension to be constantly active.
Only reference I found of this was here: https://gitmemory.com/SENya1990
An example of the code described here would be appreciated
This diagnostic has been added in the recent release.
The main point of this diagnostic is that as many extensions as possible must be conditionally disabled if they are not needed at the current moment.
When you add a new extension, you have to decide whether you need to conditionally enable your extension (thus, adding IsActive()
method with a meaningful code) or your extension must be always on (by suppressing the diagnostic in the code by adding a suppression comment).
Acuminator just makes sure that you're aware that "always-on" extensions decrease the performance. If you've decided that a particular extension must be always on, just suppress this diagnostic by adding a suppression comment in Visual Studio:
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod because this extension should be always enabled
public class MyExtension : PXGraphExtension<GraphType>
{
...
}
You can add it automatically in Visual Studio by clicking on the icon near the diagnostic lightbulb: