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

Feature => Master #51

Merged
merged 5 commits into from
Apr 20, 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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ jobs:
if: matrix.os == 'windows-latest'
uses: ncipollo/[email protected]
with:
tag: v1.4.9
tag: v1.4.9.1
21 changes: 19 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Hardware.Info;
using NvAPIWrapper.DRS.SettingValues;
using System.Linq;
using System.Net.NetworkInformation;

Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Welcome to the best benchmark in the entire universe");
Expand All @@ -24,6 +25,7 @@

if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Console.ForegroundColor = ConsoleColor.Cyan;
var startInfo = new ProcessStartInfo
{
FileName = "/usr/sbin/system_profiler",
Expand All @@ -38,8 +40,11 @@
while (!process.StandardOutput.EndOfStream)
{
string? line = process.StandardOutput.ReadLine();
//Exclusions
if (line != null && !line.Contains("Serial Number (system):") && !line.Contains("Hardware UUID:") && !line.Contains("Model Number:") && !line.Contains("Provisioning UDID:") && !line.Contains("Boot Volume:")
&& !line.Contains("Boot Mode:") && !line.Contains("Computer Name:") && !line.Contains("User Name:"))
&& !line.Contains("Boot Mode:") && !line.Contains("Computer Name:") && !line.Contains("User Name:") && !line.Contains("Kernel Version: Darwin") && !line.Contains("Secure Virtual Memory: Enabled")
&& !line.Contains("System Integrity Protection: Enabled") && !line.Contains("Time since boot:") && !line.Contains("System Firmware Version:") && !line.Contains("OS Loader Version:")
&& !line.Contains("Activation Lock Status:") && !line.Contains("Bus: Built-In") && !line.Contains("Vendor:"))
{
Console.WriteLine(line);
}
Expand All @@ -50,9 +55,9 @@
{
// GET CPU info
// Windows specific
using (var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_Processor"))

Check warning on line 58 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (macos-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 60 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-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)
{
try
{
Expand All @@ -62,12 +67,12 @@
Console.ForegroundColor = ConsoleColor.White;
Console.Write("Processor Name: ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine(item["Name"]);

Check warning on line 70 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.ForegroundColor = ConsoleColor.White;
Console.Write("Cores: ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write($"{item["NumberOfCores"]}");

Check warning on line 75 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 75 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.ForegroundColor = ConsoleColor.White;
Console.Write(", Threads: ");
Expand All @@ -75,10 +80,22 @@
Console.WriteLine(item["NumberOfLogicalProcessors"]);

Console.ForegroundColor = ConsoleColor.White;
Console.Write("Clock Speed: ");
Console.Write("Base Frequency: ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("{0}MHz", item["MaxClockSpeed"]);

IHardwareInfo hardwareInfo;
hardwareInfo = new HardwareInfo();
hardwareInfo.RefreshAll();
Console.ForegroundColor = ConsoleColor.White;
Console.Write("Current Frequency: ");
Console.ForegroundColor = ConsoleColor.Yellow;

foreach (var cpu in hardwareInfo.CpuList)
{
Console.WriteLine("{0}MHz", cpu.CurrentClockSpeed);
}

Console.ForegroundColor = ConsoleColor.White;
Console.Write("L2 Cache: ");
Console.ForegroundColor = ConsoleColor.Yellow;
Expand All @@ -87,12 +104,12 @@
Console.ForegroundColor = ConsoleColor.White;
Console.Write("L3 Cache: ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("{0}MB", (Convert.ToInt64(item["L3CacheSize"]) / 1024));

Check warning on line 107 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.ForegroundColor = ConsoleColor.White;
Console.Write("Voltage: ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("{0}V", item["CurrentVoltage"]);

Check warning on line 112 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.ForegroundColor = ConsoleColor.Magenta;
Console.WriteLine("-----------------------------------------------------------");
Expand All @@ -106,17 +123,17 @@

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

Check warning on line 126 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)

Check warning on line 126 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (macos-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)
{
try
{
// GET total MEM
long totalCapacity = 0;
string? manufacturer = null;
foreach (ManagementObject item in searcher.Get())

Check warning on line 133 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (windows-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)

Check warning on line 133 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)
{
totalCapacity += Convert.ToInt64(item["Capacity"]);

Check warning on line 135 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)
manufacturer = item["Manufacturer"]?.ToString()?.Trim();

Check warning on line 136 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.ForegroundColor = ConsoleColor.Cyan;
Expand All @@ -133,9 +150,9 @@
Console.WriteLine(manufacturer);

// GET Capacity per stick
searcher.Query = new ObjectQuery("SELECT * FROM Win32_PhysicalMemory");

Check warning on line 153 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

This call site is reachable on all platforms. 'ObjectQuery' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
int slotNumber = 1;
foreach (ManagementObject item in searcher.Get())

Check warning on line 155 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-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)

Check warning on line 155 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();
Console.ForegroundColor = ConsoleColor.White;
Expand All @@ -143,7 +160,7 @@

Console.Write("Speed: " );
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("{0} MHz", item["Speed"]);

Check warning on line 163 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.ForegroundColor = ConsoleColor.White;
Console.Write("Capacity: ");
Expand All @@ -165,7 +182,7 @@
// iGPU
try
{
using (var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_VideoController"))

Check warning on line 185 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 185 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)
{
bool hasNvidiaGPU = PhysicalGPU.GetPhysicalGPUs().Any(gpu => gpu.FullName.Contains("NVIDIA"));

Expand Down Expand Up @@ -233,10 +250,10 @@
}
}

foreach (var item in searcher.Get())

Check warning on line 253 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (windows-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)

Check warning on line 253 in Program.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-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)
{
var manufacturer = item["AdapterCompatibility"]?.ToString();

Check warning on line 255 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 255 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)
var VideoMemoryType = item["VideoMemoryType"]?.ToString();

Check warning on line 256 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 256 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)

//if (manufacturer != null && manufacturer.ToLower().Contains("nvidia"))
//{
Expand All @@ -255,7 +272,7 @@
Console.ForegroundColor = ConsoleColor.White;
Console.Write("Name: ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine(item["Name"]);

Check warning on line 275 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.ForegroundColor = ConsoleColor.White;
Console.Write("Manufacturer: ");
Expand All @@ -265,12 +282,12 @@
Console.ForegroundColor = ConsoleColor.White;
Console.Write("Driver Version: ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine(item["DriverVersion"]);

Check warning on line 285 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.ForegroundColor = ConsoleColor.White;
Console.Write("VRAM: ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("{0} MB", Convert.ToUInt64(item["AdapterRAM"]) / (1024 * 1024));

Check warning on line 290 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)

Check warning on line 290 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.ForegroundColor = ConsoleColor.Magenta;
Console.WriteLine("-----------------------------------------------------------");
Expand Down Expand Up @@ -305,7 +322,7 @@
Console.ForegroundColor = ConsoleColor.White;
Console.Write("Driver Version: ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine(item["DriverVersion"]);

Check warning on line 325 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)

if (desc.DedicatedVideoMemory == 0)
{
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- You can run a Hashing benchmark with MD5, SHA256 and SHA512.
- Or a single thread and multi thread benchmark.
- Or a encrypt/decrypt benchmark (May need admin privileges)
- Using <a href="https://github.com/dotnet/BenchmarkDotNet"> `BenchmarkDotNet` </a>, `SharpDX` and `NvAPIWrapper`.
- Using <a href="https://github.com/dotnet/BenchmarkDotNet"> `BenchmarkDotNet` </a>, `SharpDX`, `NvAPIWrapper` and `Hardware.info`

# Maintenance

Expand Down Expand Up @@ -172,12 +172,17 @@ Intel Core i7-12800H CPU 1.80GHz (Alder Lake), 1 CPU, 20 logical and 14 physical

## .NET 8 Ranking:

Testing...
1. Dell latitude 5531 - i7-12700H @ 55W `32s`
2. MacBook Pro 14" 2023 - M2 Pro 10 Core CPU (6P + 4E) `35s`
3. MacBook Pro 16" 2021 - M1 Max 10 Core CPU (8P + 2E) `42s`
4. Desktop - i7-8700K @ 4.7ghz `105s`
5. MacBook Pro 15" 2018 - i7-8850H @ 45W `133s`
6. MacBook Pro 13" 2017 - i5-7660U @ 15W `401s`

# Minimum system requirements

- .NET 8.0.2
- Dual core CPU
- Windows 10 or MacOS 12
- 4GB RAM
- 1GB Storage
- 1GB Storage
Loading