SharpZipLib icon indicating copy to clipboard operation
SharpZipLib copied to clipboard

BZip2 Same processing time on every level

Open Cyken-Zeraux opened this issue 8 years ago • 0 comments

Steps to reproduce

In the 'Cmd_BZip2' CS example in the 'Samples' library, I added some more output info under 'Command.Compress'.

https://github.com/Cyken-Zeraux/SharpZipLib/blob/master/ICSharpCode.SharpZipLib.Samples/cs/Cmd_BZip2/Cmd_BZip2.cs

Test file used: https://github.com/Cyken-Zeraux/SharpZipLib/blob/master/enwik8.7z Source: http://mattmahoney.net/dc/textdata.html (You'll need to extract it)

Simply build the project in Debug, extract test file to Cmd_Bzip2 binaries directory, CD to said directory, and run a basic compression test: "enwik8" -1 -z

wait until output

then

"enwik8" -9 -z

Replace -1 with any number between 1 and 9

Expected behavior

Compression level 1 should take around 6 seconds or so, if 7-zip is doing things accurately. Or, Compression level 9 should take much longer.

Actual behavior

Level 1 requires just as much time as level 9, 44-45 seconds in my case.

Program Output:

>Cmd_BZip2 "enwik8" -1 -z
Compressing enwik8 to enwik8.bz at level 1
Time: 44 | Output Filesize: 31.7188 MB | Original Filesize: 95.36743 MB

>Cmd_BZip2 "enwik8" -5 -z
Compressing enwik8 to enwik8.bz at level 5
Time: 44 | Output Filesize: 28.60742 MB | Original Filesize: 95.36743 MB

>Cmd_BZip2 "enwik8" -9 -z
Compressing enwik8 to enwik8.bz at level 9
Time: 45 | Output Filesize: 27.66489 MB | Original Filesize: 95.36743 MB

>Cmd_BZip2 "enwik8" -3 -z
Compressing enwik8 to enwik8.bz at level 3
Time: 44 | Output Filesize: 29.49654 MB | Original Filesize: 95.36743 MB

Oddly enough, the same pattern emerges, but in much reduced time when using the Nuget 0.86.0.518 version:

>Cmd_BZip2 "enwik8" -9 -z
Compressing enwik8 to enwik8.bz at level 9
Time: 14 | Output Filesize: 27.66489 MB | Original Filesize: 95.36743 MB

>Cmd_BZip2 "enwik8" -1 -z
Compressing enwik8 to enwik8.bz at level 1
Time: 14 | Output Filesize: 31.7188 MB | Original Filesize: 95.36743 MB

>Cmd_BZip2 "enwik8" -8 -z
Compressing enwik8 to enwik8.bz at level 8
Time: 14 | Output Filesize: 27.8508 MB | Original Filesize: 95.36743 MB

>Cmd_BZip2 "enwik8" -2 -z
Compressing enwik8 to enwik8.bz at level 2
Time: 13 | Output Filesize: 30.25724 MB | Original Filesize: 95.36743 MB 

UPDATE: Same output with https://github.com/icsharpcode/SharpZipLib/releases/tag/0.86.0.518 release, and the sourceforge .net 2 DLL from 2010: https://sourceforge.net/projects/sharpdevelop/files/SharpZipLib/0.86/SharpZipLib_0860_Bin.zip/download

Version of SharpZipLib

https://github.com/icsharpcode/SharpZipLib/commit/9ad7f5845222c99ff009a1daddedc051d25a06b9

Obtained from (place an x between the brackets for all that apply)

  • [x] Compiled from source
  • branch: master
  • commit: 9ad7f58
  • [x] Downloaded DLL from GitHub
  • [x] Downloaded DLL from SourceForge
  • [ ] Downloaded DLL from _______
  • [ ] DLL included as part of
  • Package installed using:
  • [x] NuGet
  • [ ] MyGet
  • [ ] Chocolatey

Cyken-Zeraux avatar Mar 21 '17 06:03 Cyken-Zeraux