Skip to content

Commit 1c656d1

Browse files
committed
update the docs with the change in IterationSetup behavior, #764
1 parent f925321 commit 1c656d1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

docs/articles/samples/IntroSetupCleanupIteration.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@ uid: BenchmarkDotNet.Samples.IntroSetupCleanupIteration
55
## Sample: IntroSetupCleanupIteration
66

77
A method which is marked by the [`[IterationSetup]`](xref:BenchmarkDotNet.Attributes.IterationSetupAttribute)
8-
attribute will be executed only once *before each an iteration*.
8+
attribute will be executed exactly once *before each benchmark invocation* (we have changed that in 0.11.0).
99
It's not recommended to use this attribute in microbenchmarks because it can spoil the results.
1010
However, if you are writing a macrobenchmark (e.g. a benchmark which takes at least 100ms) and
11-
you want to prepare some data before each iteration,
11+
you want to prepare some data before each invocation,
1212
[`[IterationSetup]`](xref:BenchmarkDotNet.Attributes.IterationSetupAttribute) can be useful.
13-
BenchmarkDotNet doesn't support setup/cleanup method for a single method invocation (*an operation*),
14-
but you can perform only one operation per iteration.
15-
It's recommended to use `RunStrategy.Monitoring` for such cases.
1613

1714
A method which is marked by the [`[IterationCleanup]`](xref:BenchmarkDotNet.Attributes.IterationCleanupAttribute)
18-
attribute will be executed only once *after each an iteration*.
15+
attribute will be executed exactly once *after each invocation*.
1916
This attribute has the same set of constraint with `[IterationSetup]`: it's not recommended to use
2017
[`[IterationCleanup]`](xref:BenchmarkDotNet.Attributes.IterationCleanupAttribute) in microbenchmarks.
2118

0 commit comments

Comments
 (0)