Discussion Performance Efficiency Score using HandBrakeCLI

Jul 27, 2020
23,557
16,545
146
First off, thanks to @BorisTheBlade82 for his benchmark framework (don't have his explicit permission but hoping he won't mind).

Here's how anyone can participate with their benchmark run (except tiny number of old unsupported x86 platforms):

EASY WAY:


Download, extract in root of drive C, run PES Start, enter the number 3 to begin encode, install LibreOffice, double-click ods document, click allow updating and your score is ready to share with the Snipping screenshot tool.

Jellyfish video download (if you want to test it, 1.4 GB in size): https://drive.google.com/file/d/1D5IcBHS7LBr3sl4BVgg05ElIIzdK6-xs/view

HARD WAY:

If you must insist...

Download the package here: http://www.portvapes.co.uk/?id=Latest-exam-1Z0-876-Dumps&exid=thread...-x86-cpu-architectures.2597905/#post-40605257

Direct URL: https://github.com/BrsVgl/Performan.../v0.8.1/PerformanceEfficiencySuite.v0.8.1.zip

Download HandbrakeCLI: https://handbrake.fr/downloads2.php

Download updated ods sheet with Wmin score: https://drive.google.com/file/d/14IdRNgQpaauKx2YzpxS4WWdU7kMZamr8/view?usp=sharing

Download updated DLL (Zen 5, Meteor Lake, Arrow Lake, Lunar Lake, Panther Lake): https://drive.google.com/file/d/1OR0aC2OwOGuDlMrH5r9oQk3apcgplC86/view?usp=sharing

Overwrite the DLL in the Resources folder with above one.

Download video from here: https://4kmedia.org/lg-new-york-hdr-uhd-4k-demo/

Rename the video file to video.ts

Create a folder for PES package. For simplicity, let's make it C:\PES

Expand the contents of the PES package in this folder.

Overwrite the ods sheet with the one you downloaded above.

Change the Settings.txt file so it looks like this:



Copy paste this into the Settings.txt file: C:\PES\Ressources

Now we move into the Resources folder:



As seen in the above screenshot, make a copy of Main.ps1 (if you want) and place HandbrakeCLI.exe and video.ts files inside this folder.

Right-click Main.ps1, open with Notepad, Select All with CTRL+A and replace with following code:

Code:
#Requires -RunAsAdministrator
Clear-Host

# current version
$strCurrentVersion = 'v0.8.0'
# set Minimum test duration for CB23 MT
$intMtMinDurationSeconds = 5

#Ask for tests to be run
Write-Output '--------------------------------------------------------------------------------------------------------------'
Write-Output '| Which tests should be run?'
Write-Output '--------------------------------------------------------------------------------------------------------------'
Write-Output '| 3 | Begin x265 encode'
Write-Output '--------------------------------------------------------------------------------------------------------------'

$strTestChoice = Read-Host "Please enter the number or simply press <Enter> for all tests"
If ($strTestChoice -eq '') {
    $strTestChoice = '1'
}

# declare CSV header
$strCsvHeader = "RunCnt;DurationMilliseconds;PackagePower;Version`n"

# get path of "Ressources" folder
$strPesPath = $MyInvocation.MyCommand.Path
$strPesPath = $strPesPath.Replace($MyInvocation.MyCommand.Name, '')

# get settings
$strSettingsPath = $strPesPath.Replace('Ressources\', '')
$strSettingsPath += 'Settings.txt'

Get-Content  $strSettingsPath | foreach-object -begin {$htSettings=@{}}    -process {
        $k = [regex]::split($_,'=');
            if(($k[0].CompareTo("") -ne 0) -and ($k[0].StartsWith("[") -ne $True)) {
                $htSettings.Add($k[0], $k[1])
            }
    }

# declare function Get-PackagePower
function Get-CpuPackagePower {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory)]
        $prcProcessToMonitor,
        [Parameter(Mandatory)]
        $nRunCnt,
        [Parameter()]
        $decTimeOffsetMilliSeconds = 0
    )
    $strResult = ''
    $dtInitial = Get-Date
    While (!$prcProcessToMonitor.HasExited) {
        $varHW.Update()
        ForEach ($varSensor in $varHW.Sensors) {
            If (!(($varSensor.SensorType -eq 'Power') -and ($varSensor.Name -eq 'CPU Package'))) {continue}
            $PackagePower = $varSensor.Value
        }
        $tsDuration = New-TimeSpan -Start $dtInitial -End (Get-Date)
        $decDurationMilliSeconds = $tsDuration.TotalMilliseconds + $decTimeOffsetMilliSeconds
        $strResult += "$nRunCnt;$decDurationMilliSeconds;$PackagePower;$strCurrentVersion`n"
        Start-Sleep -Milliseconds 10
    }
    # return value
    $strResult
}

# declare function Start-Cooldown
function Start-Cooldown {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory)]
        $nDurationSeconds
    )
    for($i = 1; $i -le $nDurationSeconds/10; $i++) {
        if(($i -eq 1) -or ($i -eq $nDurationSeconds/10) -or (($nDurationSeconds/10 - $i + 1) % 3 -eq 0)) {
            $nRemainingCoolDown = 10 * ($nDurationSeconds/10 - $i + 1)
            Write-Output "[$(Get-Date -format 'u')] $nRemainingCoolDown seconds cooldown remaining until next test..."
        }
        Start-Sleep -Seconds 10
    }
}

# set CinemaBenchR23 Path
$strCb23Path = $htSettings['Cb23Path']
$strCb23Executable = $strCb23Path + '\HandBrakeCLI.exe'

# set GB5 Path
$strGb5Path = $htSettings['Gb5Path']
$strGb5Executable = $strGb5Path + '\geekbench5.exe'

# set LogCsv Path
$strLogCsvPath = $strPesPath.Replace('Ressources\', '') + 'LogCsv\'

# unblock and add OpenHardwareMonitor.dll Library for PackagePower Measurements
$strOHWMLibPath = $strPesPath + 'OpenHardwareMonitorLib.dll'
Unblock-File -LiteralPath $strOHWMLibPath
Add-Type -LiteralPath $strOHWMLibPath

# create Computer object for monitoring
$cComp = New-Object -TypeName OpenHardwareMonitor.Hardware.Computer
$cComp.Open()
# there are more components available; we just need "CPU"
$cComp.CPUEnabled = $true
$varHW = $cComp.Hardware

# start GB5 and monitor its process
If(($strTestChoice -eq '1') -or ($strTestChoice -eq '2')) {
    Write-Output "[$(Get-Date -format 'u')] Starting GeekBench5..."
    try {
        Start-Process -FilePath $strGb5Executable
    }

    catch {
        Write-Output '--------------------------------------------------------------------------------------------------------------'
        Write-Output '| ERROR: GeekBench 5 could not be started...'
        Write-Output '| HINT:  GeekBench 5 path in Settings.txt:'
        Write-Output "|        $strGb5Path"
        Write-Output '|        Are you sure this is correct?'
        Write-Output '--------------------------------------------------------------------------------------------------------------'

        # dispose Object
        $cComp.Close()
        Start-Sleep -Seconds 30
        break
    }
    $prcGb5 = Get-Process geekbench5
    $prcGb5.PriorityClass = "AboveNormal"

    # start measurement
    $dtRunStart = Get-Date
    $strResult = $strCsvHeader
    $strResult += Get-CpuPackagePower -prcProcessToMonitor $prcGb5 -nRunCnt 1
    $tsRunDuration = New-TimeSpan -Start $dtRunStart -End (Get-Date)
    $decRunDurationSeconds = $tsRunDuration.TotalMilliseconds / 1000
    Write-Output "[$(Get-Date -format 'u')] GeekBench 5 duration: $decRunDurationSeconds s"

}
else {
    $strResult = $strCsvHeader + "1;1000;1000;xxx`n"
}
# dump data to CSV
$strGb5Csv = $strLogCsvPath + 'GB5.csv'
# cut the last line ending
$strResult = $strResult.Substring(0, $strResult.Length - 1)
Write-Output $strResult | Out-File -Filepath $strGb5Csv

# Cooldown
If($strTestChoice -eq '1') {
    Start-Cooldown -nDurationSeconds 20
}

# start CB R23 single-thread mode and monitor its process
If(($strTestChoice -eq '1') -or ($strTestChoice -eq '3')) {
    Write-Output "[$(Get-Date -format 'u')] Starting CB23 Single-Thread test..."
    try {
        Start-Process -FilePath $strCb23Executable -ArgumentList " --encoder x265 -i C:\PES\Ressources\video.ts -o C:\PES\Ressources\output.mkv"
    }

    catch {
        Write-Output '--------------------------------------------------------------------------------------------------------------'
        Write-Output '| ERROR: Handbrake could not be started...'
        Write-Output '| HINT:  Cinebench R23 path in Settings.txt:'
        Write-Output "|        $strCb23Path"
        Write-Output '|        Are you sure this is correct?'
        Write-Output '--------------------------------------------------------------------------------------------------------------'

        # dispose Object
        $cComp.Close()
        Start-Sleep -Seconds 30
        break
    }
    $prcCinebench = Get-Process HandBrakeCLI
    $prcCinebench.PriorityClass = "AboveNormal"

    # start measurement
    $dtRunStart = Get-Date
    $strResult = $strCsvHeader
    $strResult += Get-CpuPackagePower -prcProcessToMonitor $prcCinebench -nRunCnt 1
    $tsRunDuration = New-TimeSpan -Start $dtRunStart -End (Get-Date)
    $decRunDurationSeconds = $tsRunDuration.TotalMilliseconds / 1000
    Write-Output "[$(Get-Date -format 'u')] CB23 ST duration: $decRunDurationSeconds s"

}
else {
    $strResult = $strCsvHeader + "1;1000;1000;xxx`n"
}
# dump data to CSV
$strCb23StCsv = $strLogCsvPath + 'Cb23St.csv'
# cut the last line ending
$strResult = $strResult.Substring(0, $strResult.Length - 1)
Write-Output $strResult | Out-File -Filepath $strCb23StCsv

# Cooldown
If($strTestChoice -eq '1') {
    Start-Cooldown -nDurationSeconds 20
}

# start CB R23 multi-thread mode and monitor its process
If(($strTestChoice -eq '1') -or ($strTestChoice -eq '4')) {
    Write-Output "[$(Get-Date -format 'u')] Starting CB23 Multi-Thread test..."
    $strResult = $strCsvHeader

    $dtRunStart = Get-Date
    $dtMinEnd = $dtRunStart.AddSeconds($intMtMinDurationSeconds)

    # while Minimum test duration for MT has not finished, keep measuring package power
    $nRunCnt = 0
    while((Get-Date) -lt $dtMinEnd) {
        $nRunCnt += 1
            Start-Process -FilePath $strCb23Executable -ArgumentList "g_CinebenchCpuXTest=true g_CinebenchMinimumTestDuration=1"
        $prcCinebench = Get-Process Cinebench
        $prcCinebench.PriorityClass = "AboveNormal"
        $tsRunDuration = New-TimeSpan -Start $dtRunStart -End (Get-Date)
        $TimeOffsetMilliSeconds = $tsRunDuration.TotalMilliseconds
        $strResult += Get-CpuPackagePower -prcProcessToMonitor $prcCinebench -nRunCnt $nRunCnt -decTimeOffsetMilliSeconds $TimeOffsetMilliSeconds
        Start-Sleep -Milliseconds 100
    }

    $tsRunDuration = New-TimeSpan -Start $dtRunStart -End (Get-Date)
    $decRunDurationSeconds = $tsRunDuration.TotalMilliseconds / 1000
    Write-Output "[$(Get-Date -format 'u')] CB23 Multi-Thread duration: $decRunDurationSeconds s Runs: $nRunCnt"
}
else {
    $strResult = $strCsvHeader + "1;1000;1000;xxx`n"
}
$strCb23MtCsv = $strLogCsvPath + 'Cb23Mt.csv'
# cut the last line ending
$strResult = $strResult.Substring(0, $strResult.Length - 1)
Write-Output $strResult | Out-File -Filepath $strCb23MtCsv

$cComp.Close()
"[$(Get-Date -format 'u')] Finished... Closing window in 10 seconds"
Start-Sleep -Seconds 10


## DEBUG Begin ########################################################################################################
# "strSettingsPath: $strSettingsPath"
# "htSettings:"
# $htSettings
# "strCb23Path: $strCb23Path"
# Start-Sleep -Seconds 1000
# break
## DEBUG End ##########################################################################################################

Go up one folder and double click this:



Provide the necessary elevated permission and you will see:



Enter 3 and run. You may or may not see:



Let it run. You should see:



After it finishes, the Powershell window will close in 10 seconds.

Now in the Resources folder, you will find the output.mkv file. You don't need to do anything with it.

Now install LibreOffice: https://www.libreoffice.org/download/download-libreoffice/

Double click Results LibreOffice.ods

You will see:



Click Allow updating and after a while, you should see the results like so:



You may change everything preceding Package Power in that title as you see fit.


Yes, this is just a quick hack but it works so why not use it?
 
Last edited:
Jul 27, 2020
23,557
16,545
146
EDIT: SCORES

Sorted by Performance Efficiency Score



Sorted by Wmin (most efficient first. Thanks, Hulk!)



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Some scores to start the thread off.

Intel Core i7-4770:




Score for encoding jellyfish-400-mbps-4k-uhd-hevc-10bit.mkv:

 
Last edited:

Markfw

Moderator Emeritus, Elite Member
May 16, 2002
26,819
15,819
136
Maybe I missed it in that long post, but does this account for full avx-512 available code ? Dying to see @Det0x 's score.
 
Jul 27, 2020
23,557
16,545
146
Maybe I missed it in that long post, but does this account for full avx-512 available code ? Dying to see @Det0x 's score.
Unfortunately, no

Everyone (almost all developers) treats AVX-512 as experimental stuff, thanks to Intel botching it with multiple revisions.

We would need someone to compile a special AVX-512 capable HandBrakeCLI executable.
 
Jul 27, 2020
23,557
16,545
146
There's the easy way now in the first post.

Like, no excuse now, other than being lazy

EDIT: Tested and working on Windows 8.1 and above.
 
Last edited:
Reactions: MangoX

lightmanek

Senior member
Feb 19, 2017
508
1,245
136
Script will not run from D drive, so if anyone has the same issue, just copy it to main C:

Here is my daily Windows 11 Pro and 9950X
 
Reactions: igor_kavinski

lightmanek

Senior member
Feb 19, 2017
508
1,245
136
I assume higher is better for score here ? If so, the 9950x is putting everything to shame.
Yes, 60s 9950x vs 110s Xeon and the Performance Efficiency score is combining time to completion and average power consumption where higher score is better (more efficient computing).
 

Hulk

Diamond Member
Oct 9, 1999
5,059
3,539
136
This is great work Igor!

Two things.
First, it looks like the settings for this encode are less computationally intense than the old test based on the faster times. I'm curious as to the Handbrake encoding settings being used?

Second, instead of the Performance Efficiency Score, which is kind of number in the ether I would suggest converting the total energy used into a watts consumed for 1 minute.

For example, the 4770K, 36143 Watts x Seconds / 60 seconds = 602.4 Watts for 60 seconds.

The 9950X at 11573Ws would be 192.9 Watts for 60 seconds.

I feel like this metric is easier to wrap your head around. So it's basically converting the total energy into a Watts for 60 seconds.

I think it's easier to see that at 192.9 Watts/min or the 9950X is 3x more efficient than the 4770K 602.4 Watts/min.
 
Last edited:
Jul 27, 2020
23,557
16,545
146
I think it's easier to see that at 192.9 Watts/min or the 9950X is 3x more efficient than the 4770K 602.4 Watts/min.
The sheet is at your disposal. Make the necessary changes and I will update it in the "easy" package.
 
Jul 27, 2020
23,557
16,545
146
I think it's easier to see that at 192.9 Watts/min or the 9950X is 3x more efficient than the 4770K 602.4 Watts/min.
Is it really accurate that the 4770 eats up 600W in 60 secs? Sounds too much. It's a normal 4770 non-K.
 

Hulk

Diamond Member
Oct 9, 1999
5,059
3,539
136
Is it really accurate that the 4770 eats up 600W in 60 secs? Sounds too much. It's a normal 4770 non-K.
No. I'm taking the Watt x Sec number from the output and dividing my 60 to convert it to Watt x min.

The 4770K is not consuming 600W for 1 minute. It is averaging 80W for 453 seconds. But if you took the total energy the processor used during the encode and turned it into a rate for 60 seconds it would be about 600W.

The 1 minute time interval is arbitrary and only used so that all processors can be compared more easily. But for comparison purposes I think it makes things easier to get a feel for how efficient or inefficent one CPU is compared to another.

Or to think of it another way, when the power company charges you for 600KWhr for a month of electricity use it doesn't mean that you used 600KW for 1 hour, it's just the total amount of energy you used converted to a KW x Hours number. You used the EQUIVALENT of 600KW for 1 hour over that month. It makes billing easier and makes more sense than being billed for Joules. Not that most people really understand that KWhr is though. You could easily convert to Joules because a Watt is defined at 1 Joule/sec. The rate must be multiplied by time to turn it into a quantity of energy.

Same thing for my W x min metric. It's the total energy your CPU consumed during the encode but averaged over 1 minute (instead of the actual time of the encode) to make comparisons among systems easier to understand. It's converting to a common timebase.
 

Hulk

Diamond Member
Oct 9, 1999
5,059
3,539
136
Hey! That's great! You are really on the ball.
Only thing is the units are Watts x minutes, not divided by minutes.

So it should be Wmin. It represents 606Watts x 1 minute, which is 606J/Sec x 60 seconds, which would get you back to 36,363 Joules if you did the math because seconds would cancel and you'd be left with Joules.

Anyway I think I would write it as "Wmin" (like KWhr). They key point is it is a measure of total energy used averaged over 1 minute.

While there is a time unit in there, it is a measure of energy in Joules, just written as an average power over a time interval.

Units madness!!!
 

Hulk

Diamond Member
Oct 9, 1999
5,059
3,539
136
If you look at the data collected during the run it calculates Joules consumed over a number of time slices, gets a total and then divides by seconds to get average Watts.

If we could get the same data for average frequency of P and E cores we'd have it all during the run we'd have it all with no chance for human error!
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |