paulegradie / Sailfish

Sailfish - a production friendly performance benchmark runner for .NET
https://paulgradie.com/Sailfish/
MIT License
11 stars 4 forks source link

[FeatureRequest] RunOnce flag onthe SailfishMethodSetup/Teardown and SailfishIterationSetup/Teardown #132

Open paulegradie opened 6 months ago

paulegradie commented 6 months ago

When specifying classnames for lifecycle methods, it would be great if we could specify, e.g. one method setup for two methods - and only have that setup run once. e.g.

[SailfishMethodSetup(RunOnce: true, nameof(MethodA), nameof(MethodB))]
public void Setup(){ }

[SailfishMethod]
public void MethodA() => ...

[SailfishMethod]
public void MethodB() => ...

Where the Setup() method is executed once before the first method invocation.