Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-strecker-sonarsource committed Jan 8, 2025
1 parent 7e3de39 commit ea43292
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions rules/S1215/csharp/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,20 @@ The benchmark below illustrates how invoking `GC.Collect()` can have opposite ef

[options="header"]
|===
| Runtime | Collect | Mean | StdDev | Gen1 | Gen2 | Allocated
| .NET 9.0 | False | 659.2 ms | 15.69 ms | 21000.0000 | 6000.0000 | 205.95 MB
| .NET 9.0 | True | 888.8 ms | 15.34 ms | 21000.0000 | 7000.0000 | 205.95 MB
| | | | | | |
| .NET Framework 4.8.1 | False | 545.7 ms | 19.49 ms | 19000.0000 | 7000.0000 | 228.8 MB
| .NET Framework 4.8.1 | True | 484.8 ms | 11.79 ms | 19000.0000 | 7000.0000 | 228.8 MB
| Runtime | Collect | Mean | Standard Deviation | Allocated
| .NET 9.0 | False | 659.2 ms | 15.69 ms | 205.95 MB
| .NET 9.0 | True | 888.8 ms | 15.34 ms | 205.95 MB
| | | | |
| .NET Framework 4.8.1 | False | 545.7 ms | 19.49 ms | 228.8 MB
| .NET Framework 4.8.1 | True | 484.8 ms | 11.79 ms | 228.8 MB
|===

==== Glossary

* **Mean** Arithmetic mean of all measurements
* **StdDev** Standard deviation of all measurements
* **Gen1** GC Generation 1 collects per 1000 operations
* **Gen2** GC Generation 2 collects per 1000 operations
* **Allocated** Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)
* **1 ms** 1 Millisecond (0.001 sec)
* Collect - if `True`, `GC.Collect()` is called in the middle of the allocation heavy `Benchmark()` method
* https://en.wikipedia.org/wiki/Arithmetic_mean[Mean]
* https://en.wikipedia.org/wiki/Standard_deviation[Standard Deviation]
* https://github.com/dotnet/BenchmarkDotNet/blob/master/docs/articles/configs/diagnosers.md[Allocated]

The results were generated by running the following snippet with https://github.com/dotnet/BenchmarkDotNet[BenchmarkDotNet]:

Expand Down

0 comments on commit ea43292

Please sign in to comment.