Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Feature => Master #25

Merged
merged 5 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ jobs:
node-version: latest
check-latest: true

- name: Setup .NET Core
- name: Setup .NET Core V8
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'

- name: Restore dependencies
run: dotnet restore Benchmark.csproj

- name: Build Proj
run: dotnet build Benchmark.csproj -c Release -f net7.0
run: dotnet build Benchmark.csproj -c Release -f net8.0

- name: Build sln
run: dotnet build Benchmark.sln -c Release -f net7.0
run: dotnet build Benchmark.sln -c Release -f net8.0

- name: Create Release
if: matrix.os == 'windows-latest'
uses: ncipollo/release-action@v1.14.0
with:
tag: v1.4.6
tag: v1.4.7
4 changes: 2 additions & 2 deletions Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.9" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

while (!process.StandardOutput.EndOfStream)
{
string line = process.StandardOutput.ReadLine();

Check warning on line 26 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

Converting null literal or possible null value to non-nullable type.

Check warning on line 26 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

Converting null literal or possible null value to non-nullable type.

Check warning on line 26 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

Converting null literal or possible null value to non-nullable type.
Console.WriteLine(line);
}

Expand All @@ -35,16 +35,16 @@
{
// GET CPU info
// Windows specific
using (var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_Processor"))

Check warning on line 38 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

This call site is reachable on all platforms. 'ManagementObjectSearcher' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
{
foreach (var item in searcher.Get())

Check warning on line 40 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

This call site is reachable on all platforms. 'ManagementObjectSearcher.Get()' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
{
Console.WriteLine("[CPU information]");
Console.WriteLine("Processor Name: {0}", item["Name"]);
Console.WriteLine("Manufacturer: {0}", item["Manufacturer"]);

Check warning on line 44 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

This call site is reachable on all platforms. 'ManagementBaseObject.this[string]' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
Console.WriteLine("Core: {0}", item["NumberOfCores"]);
Console.WriteLine("Threads: {0}", item["NumberOfLogicalProcessors"]);

Check warning on line 46 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

This call site is reachable on all platforms. 'ManagementBaseObject.this[string]' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 46 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

This call site is reachable on all platforms. 'ManagementBaseObject.this[string]' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
Console.WriteLine("Clock Speed: {0}MHz", item["MaxClockSpeed"]);

Check warning on line 47 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

This call site is reachable on all platforms. 'ManagementBaseObject.this[string]' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
Console.WriteLine("L3 Cache: {0}MB", (Convert.ToInt64(item["L3CacheSize"]) / 1024));
Console.WriteLine("Voltage: {0}V", item["CurrentVoltage"]);
Console.WriteLine("-----------------------------------------------------------");
Expand All @@ -53,15 +53,15 @@

// GET RAM info
// Windows only
using (var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMemory"))

Check warning on line 56 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

This call site is reachable on all platforms. 'ManagementObjectSearcher' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 56 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

This call site is reachable on all platforms. 'ManagementObjectSearcher' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
{
// GET total MEM
long totalCapacity = 0;
string manufacturer = null;

Check warning on line 60 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

Converting null literal or possible null value to non-nullable type.

Check warning on line 60 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

Converting null literal or possible null value to non-nullable type.

Check warning on line 60 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

Converting null literal or possible null value to non-nullable type.
foreach (ManagementObject item in searcher.Get())
{
totalCapacity += Convert.ToInt64(item["Capacity"]);
manufacturer = item["Manufacturer"].ToString().Trim();

Check warning on line 64 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

Dereference of a possibly null reference.

Check warning on line 64 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

Dereference of a possibly null reference.

Check warning on line 64 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

Dereference of a possibly null reference.
}

Console.WriteLine("[Memory Information]");
Expand Down Expand Up @@ -90,7 +90,7 @@
{
var manufacturer = item["AdapterCompatibility"].ToString();
var VideoMemoryType = item["VideoMemoryType"].ToString();
if (manufacturer.ToLower().Contains("intel") || manufacturer.ToLower().Contains("amd"))

Check warning on line 93 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

Dereference of a possibly null reference.

Check warning on line 93 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

Dereference of a possibly null reference.

Check warning on line 93 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

Dereference of a possibly null reference.
{
Console.WriteLine("[Integrated GPU]");
Console.WriteLine("Name: {0}", item["Name"]);
Expand All @@ -105,7 +105,7 @@
Console.WriteLine("Name: {0}", item["Name"]);
Console.WriteLine("Manufacturer: {0}", manufacturer);
Console.WriteLine("Driver Version: {0}", item["DriverVersion"]);
Console.WriteLine("VRAM: {0}MB", item["AdapterRam"]);
Console.WriteLine("VRAM: {0}MB", Convert.ToUInt64(item["AdapterRAM"]) / (1024 * 1024));

Check warning on line 108 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

This call site is reachable on all platforms. 'ManagementBaseObject.this[string]' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
Console.WriteLine("-----------------------------------------------------------");
}
}
Expand All @@ -114,7 +114,7 @@

Console.Write("Continue to benchmark? (y/n): ");
var input = Console.ReadLine();
if (input.ToLower() == "y")

Check warning on line 117 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

Dereference of a possibly null reference.

Check warning on line 117 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

Dereference of a possibly null reference.

Check warning on line 117 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

Dereference of a possibly null reference.
{

Console.WriteLine("Choose a benchmark to run:");
Expand All @@ -124,7 +124,7 @@
Console.WriteLine("4. Run all benchmarks");
Console.Write("Enter the number of your choice: ");

string choice = Console.ReadLine();

Check warning on line 127 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

Converting null literal or possible null value to non-nullable type.

Check warning on line 127 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

Converting null literal or possible null value to non-nullable type.

Check warning on line 127 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

Converting null literal or possible null value to non-nullable type.

switch (choice)
{
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Benchmark (.NET 7)
# Benchmark (.NET 8)
- A C# console program that gathers your system details then lets you run benchmarks on your system.
- You can run a Hashing benchmark with MD5, SHA256 and SHA512.
- Or a single thread and multi thread benchmark.
Expand Down Expand Up @@ -123,16 +123,19 @@ Intel Core i7-12800H CPU 1.80GHz (Alder Lake), 1 CPU, 20 logical and 14 physical
| Sha512 | 449.0 ns | 8.52 ns | 7.97 ns |
| Md5 | 271.1 ns | 5.49 ns | 7.14 ns |

## Ranking:
## .NET 7 Ranking:
1. Dell latitude 5531 `46s`
2. MacBook Pro 14" 2023 `92s`
2. MacBook Pro 16" 2021 `98s`
3. 8700K Desktop `151s`
4. MacBook Pro 15" 2018 `191s`
5. MacBook Pro 13" 2017 `573s`

## .NET 8 Ranking:
Testing comenced

# Minimum system requirements
- .NET 7
- .NET 8.0.2
- Dual core CPU
- Windows 10 or MacOS 12
- 4GB RAM
Expand Down
Loading