From 37828964ccd23294feea81a762533cf6379eed6d Mon Sep 17 00:00:00 2001 From: Oriol Mesa Date: Mon, 16 Aug 2021 15:51:50 +0200 Subject: [PATCH] Clarify effects of IterationSetup on UnrollFactor and InvocationCount As mentioned in https://github.com/dotnet/BenchmarkDotNet/issues/730#issuecomment-389971683 --- docs/articles/samples/IntroSetupCleanupIteration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/articles/samples/IntroSetupCleanupIteration.md b/docs/articles/samples/IntroSetupCleanupIteration.md index d90bfd686d..6a55adbae5 100644 --- a/docs/articles/samples/IntroSetupCleanupIteration.md +++ b/docs/articles/samples/IntroSetupCleanupIteration.md @@ -5,7 +5,7 @@ uid: BenchmarkDotNet.Samples.IntroSetupCleanupIteration ## Sample: IntroSetupCleanupIteration A method which is marked by the [`[IterationSetup]`](xref:BenchmarkDotNet.Attributes.IterationSetupAttribute) - attribute will be executed exactly once *before each benchmark invocation* (we have changed that in 0.11.0). + attribute will be executed exactly once *before each benchmark invocation*, forcing `UnrollFactor=1` and `InvocationCount=1` (we have changed that in 0.11.0). It's not recommended to use this attribute in microbenchmarks because it can spoil the results. However, if you are writing a macrobenchmark (e.g. a benchmark which takes at least 100ms) and you want to prepare some data before each invocation,