Skip to content

Commit c0f1c13

Browse files
committed
Update nuget packages + add Dark theme support to HTMLs
1 parent d243738 commit c0f1c13

22 files changed

+5065
-4538
lines changed

DotNet-Collections-Benchmark.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
13-
<PackageReference Include="BenchmarkDotNetVisualizer" Version="1.0.7" />
12+
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
13+
<PackageReference Include="BenchmarkDotNetVisualizer" Version="2.0.1" />
1414
<PackageReference Include="Shouldly" Version="4.2.1" />
1515
<PackageReference Include="DeepEqual" Version="5.1.0" />
1616
</ItemGroup>

Program.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,28 @@ static async Task VisualizeInitializeBenchmarks(BenchmarkInfo[] benchmarkInfo)
4444
Title = null!, //Set per case
4545
MainColumn = "Method",
4646
GroupByColumns = ["Length", "Sorted"],
47-
PivotProperty = "DataType",
47+
PivotColumn = "DataType",
4848
StatisticColumns = null!, //Set per case
4949
ColumnsOrder = ["Int32", "String", "StructInts", "ClassInts", "RecordStructInts", "RecordClassInts", "StructStrings", "ClassStrings", "RecordStructStrings", "RecordClassStrings"],
5050
SpectrumStatisticColumn = true,
5151
HighlightGroups = true,
5252
DividerMode = RenderTableDividerMode.SeparateTables,
5353
HtmlWrapMode = HtmlDocumentWrapMode.RichDataTables,
54+
Theme = Theme.Light
5455
};
5556

5657
options.Title = "Benchmark of Collection Initializing in terms of Execution Time (Mean)";
5758
options.StatisticColumns = ["Mean"];
5859
await benchmarkInfo.JoinReportsAndSaveAsHtmlAndImageAsync(
5960
htmlPath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-Initialize-Mean.html"),
60-
imagePath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-Initialize-Mean.webp"),
61+
imagePath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-Initialize-Mean.png"),
6162
options: options);
6263

6364
options.Title = "Benchmark of Collection Initializing in terms of Allocation Size";
6465
options.StatisticColumns = ["Allocated"];
6566
await benchmarkInfo.JoinReportsAndSaveAsHtmlAndImageAsync(
6667
htmlPath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-Initialize-Allocated.html"),
67-
imagePath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-Initialize-Allocated.webp"),
68+
imagePath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-Initialize-Allocated.png"),
6869
options: options);
6970
}
7071

@@ -80,28 +81,29 @@ static async Task VisualizeContainsBenchmarks(BenchmarkInfo[] benchmarkInfo)
8081
Title = null!, //Set per case
8182
MainColumn = "Method",
8283
GroupByColumns = ["Existed"],
83-
PivotProperty = "DataType",
84+
PivotColumn = "DataType",
8485
StatisticColumns = null!, //Set per case
8586
OtherColumnsToSelect = ["Big O", "Length"],
8687
ColumnsOrder = ["Int32", "String", "StructInts", "ClassInts", "RecordStructInts", "RecordClassInts", "StructStrings", "ClassStrings", "RecordStructStrings", "RecordClassStrings"],
8788
SpectrumStatisticColumn = true,
8889
HighlightGroups = true,
8990
DividerMode = RenderTableDividerMode.SeparateTables,
9091
HtmlWrapMode = HtmlDocumentWrapMode.RichDataTables,
92+
Theme = Theme.Light
9193
};
9294

9395
options.Title = "Benchmark of Collection Searching (Contains method) in terms of Execution Time (Mean)";
9496
options.StatisticColumns = ["Mean"];
9597
await benchmarkInfo.JoinReportsAndSaveAsHtmlAndImageAsync(
9698
htmlPath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-SearchContains-Mean.html"),
97-
imagePath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-SearchContains-Mean.webp"),
99+
imagePath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-SearchContains-Mean.png"),
98100
options: options);
99101

100102
options.Title = "Benchmark of Collection Searching (Contains method) in terms of Allocation Size";
101103
options.StatisticColumns = ["Allocated"];
102104
await benchmarkInfo.JoinReportsAndSaveAsHtmlAndImageAsync(
103105
htmlPath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-SearchContains-Allocated.html"),
104-
imagePath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-SearchContains-Allocated.webp"),
106+
imagePath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-SearchContains-Allocated.png"),
105107
options: options);
106108
}
107109

@@ -117,28 +119,29 @@ static async Task VisualizeTryGetValueBenchmarks(BenchmarkInfo[] benchmarkInfo)
117119
Title = null!, //Set per case
118120
MainColumn = "Method",
119121
GroupByColumns = ["Existed"],
120-
PivotProperty = "DataType",
122+
PivotColumn = "DataType",
121123
StatisticColumns = null!, //Set per case
122124
OtherColumnsToSelect = ["Big O", "Length"],
123125
ColumnsOrder = ["Int32", "String", "StructInts", "ClassInts", "RecordStructInts", "RecordClassInts", "StructStrings", "ClassStrings", "RecordStructStrings", "RecordClassStrings"],
124126
SpectrumStatisticColumn = true,
125127
HighlightGroups = true,
126128
DividerMode = RenderTableDividerMode.SeparateTables,
127129
HtmlWrapMode = HtmlDocumentWrapMode.RichDataTables,
130+
Theme = Theme.Light
128131
};
129132

130133
options.Title = "Benchmark of Collection Searching (TryGetValue method) in terms of Execution Time (Mean)";
131134
options.StatisticColumns = ["Mean"];
132135
await benchmarkInfo.JoinReportsAndSaveAsHtmlAndImageAsync(
133136
htmlPath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-SearchTryGetValue-Mean.html"),
134-
imagePath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-SearchTryGetValue-Mean.webp"),
137+
imagePath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-SearchTryGetValue-Mean.png"),
135138
options: options);
136139

137140
options.Title = "Benchmark of Collection Searching (TryGetValue method) in terms of Allocation Size";
138141
options.StatisticColumns = ["Allocated"];
139142
await benchmarkInfo.JoinReportsAndSaveAsHtmlAndImageAsync(
140143
htmlPath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-SearchTryGetValue-Allocated.html"),
141-
imagePath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-SearchTryGetValue-Allocated.webp"),
144+
imagePath: DirectoryHelper.GetPathRelativeToProjectDirectory("docs\\Benchmark-SearchTryGetValue-Allocated.png"),
142145
options: options);
143146
}
144147

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,38 +40,39 @@ If you find this repository useful and like it, why not give it a star? if not,
4040

4141
### Benchmark of Collection Initializing in terms of Execution Time (Mean)
4242

43-
- Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Mean.html)
44-
- Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Mean.png)
43+
- **Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Mean.html)**
44+
- **Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Mean.png)**
4545

4646
![Benchmark-Initialize-Mean-Preview](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Mean-Preview.png)
4747

4848
### Benchmark of Collection Initializing in terms of Allocation Size
4949

50-
- Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Allocated.html)
51-
- Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Allocated.png)
50+
- **Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Allocated.html)**
51+
- **Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Allocated.png)**
5252

5353
![Benchmark-Initialize-Allocated-Preview](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Allocated-Preview.png)
5454

5555
### Benchmark of Collection Searching (TryGetValue method) in terms of Execution Time (Mean)
5656

57-
- Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Mean.html)
58-
- Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Mean.png)
57+
- **Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Mean.html)**
58+
- **Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Mean.png)**
5959

6060
![Benchmark-SearchTryGetValue-Mean-Preview](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Mean-Preview.png)
6161

6262
### Benchmark of Collection Searching (TryGetValue method) in terms of Allocation Size
6363

64-
- Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Allocated.html)
65-
- Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Allocated.png)
64+
- **Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Allocated.html)**
65+
- **Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Allocated.png)**
6666

6767
![Benchmark-SearchTryGetValue-Allocated-Preview](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Allocated-Preview.png)
6868

6969
## BenchmarkDotNetVisualizer🌈
7070

71-
All the benchmarks are visualized using [BenchmarkDotNetVisualizer](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer).
71+
All the benchmarks are created by [BenchmarkDotNetVisualizer](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer).
7272

7373
## Todo
7474

75+
- [ ] Add .NET 9.0 **OrderedDictionary** to the benchmarks
7576
- [ ] Add benchmarks for other operations such as **Add**, **Insert**, **Remove**, and **Update**.
7677

7778
## Useful Resources

0 commit comments

Comments
 (0)