Friday, May 08, 2009

Testing WinRAR 3.90 beta

I recently had to evaluate the preformance of the Rarsofts new beta of WinRAR.
WinRAR is a powerful GUI and CLI archiever that handles many archieve formats.
In order to test the preformance I installed WinRAR 3.80 as well as WinRAR 3.90beta1 (in both 32 and 64-bit versions).

Here is a light version of the PowerShell script I came up with (please adjust file paths and $source according to your own need):

Function Test-Rar {
    param ($winrar = "c:\Program Files (x86)\WinRAR\Rar.exe",
        $source = "d:\psref351.pdf",
        $target = "c:\test.rar",
        $testruns = 1)
    $version = & $winrar
    Write-Host "Test using: $winrar" -fore "green"
    Write-Host $version[1] -fore "green"
    for ($i = 1; $i -le $testruns; $i++){
        if (Test-Path $target) { del $target }
        $time = Measure-Command {& $winrar a $target $source}
        $sourcesize = (Get-ChildItem $source).length
        $targetsize = (Get-ChildItem $target).length
        $obj = New-Object Object
        $obj | Add-Member Noteproperty Testrun -value $i
        $obj | Add-Member Noteproperty TimeInSeconds -value ([math]::round(($time.totalseconds), 2))
        $obj | Add-Member Noteproperty SourceByteSize -value $sourcesize
        $obj | Add-Member Noteproperty TargetByteSize -value $targetsize
        $obj | Add-Member Noteproperty CompressionPercent -value ([math]::round( (1-($targetsize / $sourcesize)) * 100,2))
        $obj
    }
}

The above function can be use in the following way:

Test-Rar -source "d:\psref351.pdf" -target "d:\test.rar"


However, I needed to run tests with several versions of WinRAR and compress rather large files. So I needed a small function to repeat the same test multipel times with different versions of WinRAR.

Function MultiTest {
    Param ($rarversions = "c:\Program Files (x86)\WinRAR\Rar.exe")
    foreach ($rarversion in $rarversions) {
        $result = Test-RAR -testruns 5 -winrar $rarversion
        $result
        $stat = $result | Measure-Object -Property TimeInSeconds -min -max -average
        $stat | Add-Member Noteproperty Executable -value $rarversion
        $stat
    }
}

Here is how to use the function:

$rarversions = "c:\Program Files (x86)\WinRAR\Rar.exe", "D:\wrar39b1\rar.exe", "D:\winrar-x64-39b1\rar.exe"
$result = MultiTest $rarversions
$result | Select Executable, Count, Average, Maximum, Minimum | ft -au


While this is not a preview of the new WinRAR version, my results indicate a decrease in the time required to create a .rar file in the 20-30% range. Most impressive indeed!

7 comments:

Михаил said...

Why not try 7-zip instead of WinRAR? The amount of compression of files with 7-zip is better than that of WinRAR.

My test of modern archivers (WinRAR, 7zip, FreeARC, Nanozip, PIM, Bee, DARK, PEAZIP, CoffeeARC...)(update May 2009):
http://www.l1957.ru/freesoft/test-arkhivatorov/archiver-test/

Exotic Hadron said...

Hello Jakob. Thank you for sharing yet another great script with us!
A little question. You are writing here "The above function can be use in the following way:" The following line, however, is blank. What would be the way, I wonder? Seems like some lines are missing.
I am trying to find the best way to run a program by passing a set of predefined switches to it, and I am sure, that what you've done here would exactly fit my needs.
Thank you, once again! BTW, there seems to be a problem with displaying your blog in IE8 x86 for Windows XP Professional SP3. Every time I open it I get an error as if the browser quirked on processing it. The only way for me to get the page opened is to click Back in browser.

Exotic Hardon said...

@Mikhail:
I believe the reason for this was to test WinRAR. Indeed, WinRAR is a good balance between speed and effectiveness. And, after all it miles ahead the Igor's 7Z Manager in the ease of use. Second, it could be a good checkup of how good LZ77 is when used with Eugene's modeling on 64-bit vectors. BTW, if I were packing large amounts of data, I would probably try using Bulat's Freearc.
Last but not least - to my knowledge LZMA is extremely good in packing PDF docs.

Jakob Bindslet said...

Thanks for pointing out those two issues Exotic Hardon - I'll look into them.

Anonymous said...

Hi I recently moved from Xp to Win7 RC on my Phenom 9850 4GB Ram. In XP, the hardware and speed test always gave a result of 1.6 Mb/s, now in Win7 I only get 1.1 Mb/s. Any idea why? quite rare, cause now anything seems to show up more quickly.

Anonymous said...

Hi I recently moved from Xp to Win7 RC on my Phenom 9850 4GB Ram. In XP, the hardware and speed test always gave a result of 1.6 Mb/s, now in Win7 I only get 1.1 Mb/s. Any idea why? quite rare, cause now anything seems to show up more quickly.

Jakob Bindslet said...

My post is about using PowerShell, not specific performance issues. I would recommend looking for forums about WinZip.