I frequently use the builtin Time() function to test rule performance during validation, but that's only one test case.
I decided to build a Python tool that will do this profiling for you, it will disable all rules but the one being tested and trigger a row update on all features in the provided datasource (this will obviously only work for rules that are set to trigger on Update). The final output for each tested feature will be an agregate features/second count for the ruleset.
Included are several helper classes:
AttributeRule
@dataclass
class AttributeRule:
_parent: str
batch: bool
checkParameters: dict[str, str]
creationTime: str
description: str
errorMessage: str
errorNumber: int
evaluationOrder: int
excludeFromClientEvaluation: bool
fieldName: str
id: int
isEnabled: bool
name: str
referencesExternalService: bool
requiredGeodatabaseClientVersion: str
scriptExpression: str
severity: int
subtypeCode: int
subtypeCodes: list[int]