P7-zip in Linux slower than 7-zip in windows

2007-06-21
2013-05-28
  • Dickey Wang
    Dickey Wang
    2007-06-21

    Dear all,

    Recently I installed 7-zip under windows and p7-zip under Ubuntu Linux on my dual-boot computer, and I noticed that the compressing speed under Linux is much slower than it is in Windows. It takes 30-40seconds to compress a 30MB plain text file in Linux, but only 10-15 seconds to compress the same file under Windows, both with the default (p)7-zip settings.
    I'd like to know if this is normal. I know very little about compression algorithms, but I assume both p7-zip and 7-zip uses the same algorithm therefore it is difficult for me to understand the huge speed difference.

     
    • my space
      my space
      2007-06-22

      > Recently I installed 7-zip under windows and p7-zip under Ubuntu Linux on my dual-boot computer
      what is the version of 7-zip under windows ?
      what is the version of p7zip under Linux ?

      what is your processor (Intel Duo Core 2) ?

      You should test with the same version : 4.47.
      for Linux, use my binaries : p7zip_4.47.1_x86_linux_bin.tar.bz2
      (http://sourceforge.net/project/showfiles.php?group_id=111810)
      For windows, use 7za.exe from 7za447.zip
      (http://sourceforge.net/project/showfiles.php?group_id=14481)

      I know that the compiler in Visual C++ 6 builds a speeder code/program than gcc ...

      You should test :
      - on Windows with 7za.exe
      - on Ubuntu with 7za
      - on Ubuntu with 7za.exe  (the 7za.exe from Windows ;)

      To run 7za.exe, you shall install the wine package under Ubuntu.

      Please post your benchmark result.

       
    • Dickey Wang
      Dickey Wang
      2007-06-22

      I'm deeply sorry. It looks like the result I got under windows is not correct. It seems I was using 7zip to compress file into .zip format instead of .7z by mistake. I just tried in the correct way, and now 7za in Linux, 7za.exe in Linux with wine and 7za.exe in Windows all perform at roughly the same speed. Here is the result on my laptop with Core Duo T2500 CPU and 2GB DDR2-667 RAM.

      Linux 7za
      real    0m32.872s
      user    0m57.880s
      sys     0m0.444s

      Linux wine Linux, 7za.exe
      real    0m32.333s
      user    0m51.503s
      sys     0m1.080s

      Windows 7za.exe
      about 30seconds

      Again, sorry about the wrong information in my first post.

       
    • Dickey Wang
      Dickey Wang
      2007-06-23

      OK, just tested on another two AMD machine (Opteron 180 2.4Ghz, 2GB DDR-400) with identical hardware,compressing the same 31MB text file with the settings, and I found something interesting.

      System 1: Ubuntu 7.04 X84-64 with 7za 4.47:
        24 seconds (both the downloaded (i386)bin version and the 64bit executable that I manually compiled ) with gcc, both takes 24seconds)

      System 2: Windows XP pro with 7za.exe 4.47:
      14 seconds(the 7zip GUI actually shows the compressing speed which is above 2MBytes/sec).

      I don't have the root authorization on system 1 so I can't install wine and run 7za.exe

       
      • Igor Pavlov
        Igor Pavlov
        2007-06-23

        - System 1: Ubuntu 7.04 X84-64 with 7za 4.47: 24 seconds

        Maybe it's CPU time?
        7-Zip (p7zip) can use 2 threads. So real time can be smaller than CPU time.

         
        • Dickey Wang
          Dickey Wang
          2007-06-23

          The interesting part is that both results are real time.

           
      • my space
        my space
        2007-06-23

        Since version 7.47, you have a "benchmark" command that tests only the LZMA compressor/decompressor (codec)

        Here is my result with my laptop :

        AMD Turion 1.8Ghz RAM : 1GB

        $ wine ./7za447.exe b

        7-Zip (A) 4.47 beta  Copyright (c) 1999-2007 Igor Pavlov  2007-05-27

        RAM size:    1000 MB,  # CPU hardware threads:   1
        RAM usage:    419 MB,  # Benchmark threads:      1

        Dict        Compressing          |        Decompressing
              Speed Usage    R/U Rating  |    Speed Usage    R/U Rating
               KB/s     %   MIPS   MIPS  |     KB/s     %   MIPS   MIPS

        22:    1182     0 11709629   1150  |    15274     0 16868819   1667
        23:    1270     0 13143551   1294  |    15148     0 16943719   1674
        24:    1211     0 13221358   1302  |    14960     0 16968212   1674
        25:    1156     0 13342206   1320  |    14996     0 17052705   1699
        ----------------------------------------------------------------
        Avr:            0 12854186   1266                 0 16958364   1678
        Tot:            0 14906275   1472

        $ p7zip_4.47.1/bin/7za b

        7-Zip (A) 4.47 beta  Copyright (c) 1999-2007 Igor Pavlov  2007-05-27
        p7zip Version 4.47 (locale=fr_FR.UTF-8,Utf16=on,HugeFiles=on,1 CPU)

        RAM size:    1000 MB,  # CPU hardware threads:   1
        RAM usage:    419 MB,  # Benchmark threads:      1

        Dict        Compressing          |        Decompressing
              Speed Usage    R/U Rating  |    Speed Usage    R/U Rating
               KB/s     %   MIPS   MIPS  |     KB/s     %   MIPS   MIPS

        22:     894    98    883    869  |    12221    99   1347   1333
        23:    1068    99   1101   1088  |    12189    99   1364   1347
        24:    1023    99   1115   1100  |    12048    99   1367   1348
        25:     986   100   1132   1126  |    12079   100   1369   1368
        ----------------------------------------------------------------
        Avr:           99   1057   1046                99   1362   1349
        Tot:           99   1210   1198

        As you can see, under wine, 7-zip does not compute the usage,
        but you can look at the "Rating MIPS" column.

        Visual C++ 6 under wine : Tot 1472
        gcc : Tot 1198

        It shows that Visual C++ 6 builds a speeder code for an algorithm like LZMA.

        Remark : Visual Studio 2005 builds a code slower than Visual C++ 6 does !

        Perhaps, you can try to use gcc compiler options to build a tuned p7zip for your CPU.

         
        • Dickey Wang
          Dickey Wang
          2007-06-24

          Thank you for the suggestion myspace!! I downloaded the source and compiled it using the default makefile.machine file with gcc 4.1.2, and the compiled 7za in linux runs as fast as (even a little bit faster than) it is in Windows. Here are the benchmark results:

          7za.exe windows:
          RAM size:    2046 MB,  # CPU hardware threads:   2
          RAM usage:    425 MB,  # Benchmark threads:      2

          Dict        Compressing          |        Decompressing
                Speed Usage    R/U Rating  |    Speed Usage    R/U Rating
                 KB/s     %   MIPS   MIPS  |     KB/s     %   MIPS   MIPS

          22:    2831   131   2105   2754  |    41344   200   2260   4512
          23:    2855   148   1964   2909  |    40815   200   2261   4512
          24:    2845   150   2035   3059  |    40482   200   2269   4530
          25:    2816   156   2057   3216  |    40153   200   2274   4549
          ----------------------------------------------------------------
          Avr:          146   2040   2984               200   2266   4526
          Tot:          173   2153   3755

          7za in Linux (downloaded BIN):
          RAM size:    2011 MB,  # CPU hardware threads:   2
          RAM usage:    425 MB,  # Benchmark threads:      2

          Dict        Compressing          |        Decompressing
                Speed Usage    R/U Rating  |    Speed Usage    R/U Rating
                 KB/s     %   MIPS   MIPS  |     KB/s     %   MIPS   MIPS

          22:    2181   133   1593   2122  |    33591   199   1837   3666
          23:    2281   140   1655   2324  |    33229   199   1841   3673
          24:    2278   143   1713   2449  |    32845   199   1842   3675
          25:    2220   145   1751   2535  |    32491   199   1853   3681
          ----------------------------------------------------------------
          Avr:          140   1678   2357               199   1843   3674
          Tot:          170   1761   3016

          7za in Linux (compiled from the source with gcc 4.1.2):
          RAM size:    2011 MB,  # CPU hardware threads:   2
          RAM usage:    425 MB,  # Benchmark threads:      2

          Dict        Compressing          |        Decompressing
                Speed Usage    R/U Rating  |    Speed Usage    R/U Rating
                 KB/s     %   MIPS   MIPS  |     KB/s     %   MIPS   MIPS

          22:    3309   149   2164   3219  |    41475   199   2277   4527
          23:    3324   153   2207   3387  |    41004   199   2272   4533
          24:    2784   143   2095   2993  |    40603   199   2278   4543
          25:    2718   148   2101   3104  |    39938   199   2272   4524
          ----------------------------------------------------------------
          Avr:          148   2142   3176               199   2275   4532
          Tot:          174   2208   3854

          cheers!

           
          • my space
            my space
            2007-06-24

            > Thank you for the suggestion myspace!! I downloaded the source and compiled it using the default makefile.machine file with gcc 4.1.2,

            Warning : the default makefile.machine uses only C/C++ source.

            If you want to use asm source to build p7zip, you should try :
            p7zip for x86  : cp makefile.linux_x86_asm_gcc_4.X makefile.machine
            p7zip for x86_64 : cp makefile.linux_amd64_asm makefile.machine
            then
            make clean
            make test

            then to benchmark : 7za -mm=crc b

            You should have the same speed on Linux and Windows because, this benchmark tests the asm part of p7zip ...

             
          • Igor Pavlov
            Igor Pavlov
            2007-06-24

            -  downloaded the source and compiled it using the default makefile.machine file with gcc 4.1.2, and the compiled 7za in linux runs as fast as (even a little bit faster than) it is in Windows.

            Did you test 32-bit version in Linux?
            64-bit version in Windows is faster than 32-bit version.

             
          • Ux64
            Ux64
            2008-06-08

            Just for benchmark information.

            $ 7z b

            7-Zip 4.57  Copyright (c) 1999-2007 Igor Pavlov  2007-12-06
            p7zip Version 4.57 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)

            RAM size:    2013 MB,  # CPU hardware threads:   4
            RAM usage:    850 MB,  # Benchmark threads:      4

            Dict        Compressing          |        Decompressing
                  Speed Usage    R/U Rating  |    Speed Usage    R/U Rating
                   KB/s     %   MIPS   MIPS  |     KB/s     %   MIPS   MIPS

            22:    7126   314   2211   6933  |    80661   367   2262   8302
            23:    6690   309   2207   6817  |    80888   372   2267   8440
            24:    6483   313   2225   6971  |    82316   383   2273   8704
            25:    6233   321   2214   7117  |    81778   386   2270   8761
            ----------------------------------------------------------------
            Avr:          314   2214   6959               377   2268   8552
            Tot:          346   2241   7756