This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Running; | |
| /// <summary> | |
| /// Refer to the README.MD for details about: | |
| /// 1. description of each benchmark | |
| /// 2. results | |
| /// 3. analysis of the results | |
| /// | |
| /// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Main() | |
| { | |
| var summary = BenchmarkRunner.Run<LinqToXmlXNameAtomizationBenchmark>(); | |
| // xml test data | |
| //<aw:Root xmlns:aw="http://www.adventure-works.com"> | |
| // <aw:Data ID="1">4,100,000</aw:Data> | |
| // <aw:Data ID="2">3,700,000</aw:Data> | |
| // <aw:Data ID="3">1,150,000</aw:Data> | |
| //</aw:Root> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [MemoryDiagnoser] | |
| [GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] | |
| [CategoriesColumn] | |
| [Config(typeof(IterationBenchmarks.IterationBenchmarksConfig))] | |
| public class IterationBenchmarks | |
| { | |
| [Params(1_000, 10_000, 50_000)] | |
| public int Count; | |
| private ArrayList _arrayList = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [MemoryDiagnoser] | |
| [GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] | |
| [CategoriesColumn] | |
| [Config(typeof(IterationBenchmarks.IterationBenchmarksConfig))] | |
| public class IterationBenchmarks | |
| { | |
| [Params(1_000, 10_000, 50_000)] | |
| public int Count; | |
| private ArrayList _arrayList = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [MemoryDiagnoser] | |
| [GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] | |
| [CategoriesColumn] | |
| [Config(typeof(IterationBenchmarks.IterationBenchmarksConfig))] | |
| public class IterationBenchmarks | |
| { | |
| [Params(1_000, 10_000, 50_000)] | |
| public int Count; | |
| private ArrayList _arrayList = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections; | |
| using System.Runtime.CompilerServices; | |
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Columns; | |
| using BenchmarkDotNet.Configs; | |
| using BenchmarkDotNet.Engines; | |
| using BenchmarkDotNet.Running; | |
| [MemoryDiagnoser] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [MemoryDiagnoser] | |
| [Config(typeof(DictionaryKeyAddBenchmarks.DictionaryKeyAddBenchmarksConfig))] | |
| public class DictionaryKeyAddBenchmarks | |
| { | |
| private readonly Consumer _consumer = new Consumer(); | |
| private Guid[] _guidKeys = Array.Empty<Guid>(); | |
| private string[] _string_20_Keys = Array.Empty<string>(); | |
| private string[] _string_50_Keys = Array.Empty<string>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [MemoryDiagnoser] | |
| public class DictionaryKeyLookupHitBenchmarks | |
| { | |
| private readonly Consumer _consumer = new Consumer(); | |
| private Guid[] _guidKeys = Array.Empty<Guid>(); | |
| private string[] _string20Keys = Array.Empty<string>(); | |
| private string[] _string50Keys = Array.Empty<string>(); | |
| private Dictionary<Guid, int> _guidDictionary = new Dictionary<Guid, int>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [MemoryDiagnoser] | |
| [GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] | |
| [Config(typeof(IterationBenchmarks_for_vs_foreach_ValueType.IterationBenchmarksConfig))] | |
| public class IterationBenchmarks_for_vs_foreach_ValueType | |
| { | |
| [Params(1_000, 10_000, 50_000)] | |
| public int Count; | |
| private List<int> _listOfInt = null; | |
| private Consumer _consumer = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // run with: | |
| // dotnet run -c Release --framework net10.0 -- --filter * | |
| // * Summary * |
OlderNewer