diff --git a/.github/workflows/perf-compare.yml b/.github/workflows/perf-compare.yml index 571a7e6..1c738f5 100644 --- a/.github/workflows/perf-compare.yml +++ b/.github/workflows/perf-compare.yml @@ -114,7 +114,16 @@ jobs: "lsass", "csrss", "services", - "svchost" + "svchost", + "smss", + "wininit", + "dwm", + "RuntimeBroker", + "SearchIndexer", + "spoolsv", + "taskhostw", + "fontdrvhost", + "conhost" ) Write-Host "Testing process lookup performance on $($testProcesses.Count) processes" -ForegroundColor Yellow @@ -231,26 +240,32 @@ jobs: Write-Host "=====================================" -ForegroundColor Cyan Write-Host "" - # Calculate speed differences - $cppVsGo = [Math]::Round((($goTotal - $cppTotal) / $goTotal) * 100, 1) - + # Calculate speed differences using times instead of percentages Write-Host "Performance comparison:" -ForegroundColor Yellow - if ($cppVsGo -gt 0) { - Write-Host " C++ is $cppVsGo% faster than Go" -ForegroundColor Green - } elseif ($cppVsGo -lt 0) { - Write-Host " C++ is $([Math]::Abs($cppVsGo))% slower than Go" -ForegroundColor Red - } else { - Write-Host " C++ and Go have equal performance" -ForegroundColor Yellow + + # C++ vs Go + if ($cppTotal -gt 0 -and $goTotal -gt 0) { + $cppVsGoTimes = [Math]::Round($goTotal / $cppTotal, 1) + if ($cppVsGoTimes -ge 1.1) { + Write-Host " C++ is $($cppVsGoTimes)x faster than Go" -ForegroundColor Green + } elseif ($cppVsGoTimes -le 0.9) { + $goVsCppTimes = [Math]::Round($cppTotal / $goTotal, 1) + Write-Host " Go is $($goVsCppTimes)x faster than C++" -ForegroundColor Red + } else { + Write-Host " C++ and Go have similar performance" -ForegroundColor Yellow + } } - if ($hasRust) { - $cppVsRust = [Math]::Round((($rustTotal - $cppTotal) / $rustTotal) * 100, 1) - if ($cppVsRust -gt 0) { - Write-Host " C++ is $cppVsRust% faster than Rust" -ForegroundColor Green - } elseif ($cppVsRust -lt 0) { - Write-Host " C++ is $([Math]::Abs($cppVsRust))% slower than Rust" -ForegroundColor Red + # C++ vs Rust + if ($hasRust -and $cppTotal -gt 0 -and $rustTotal -gt 0) { + $cppVsRustTimes = [Math]::Round($rustTotal / $cppTotal, 1) + if ($cppVsRustTimes -ge 1.1) { + Write-Host " C++ is $($cppVsRustTimes)x faster than Rust" -ForegroundColor Green + } elseif ($cppVsRustTimes -le 0.9) { + $rustVsCppTimes = [Math]::Round($cppTotal / $rustTotal, 1) + Write-Host " Rust is $($rustVsCppTimes)x faster than C++" -ForegroundColor Red } else { - Write-Host " C++ and Rust have equal performance" -ForegroundColor Yellow + Write-Host " C++ and Rust have similar performance" -ForegroundColor Yellow } } Write-Host ""