Announcement

Collapse
No announcement yet.

Disadvantages of using lzma compression method

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Disadvantages of using lzma compression method

    Now i am using default compression level in my nsis setup. but i tried using
    code:
    Setcompressor /solid lzma
    and found that my setp size reduced from 60 mb to 40 mb. So it was nice.
    I saw article about Setcompressor also.

    Now i want to know is there any problem or disadvantage in using lzma method in NSIS. Because i am planning to use it. So reply me with your suggestions.

  • #2
    Using '/solid' means that the installer will be compressed as one whole file, instead of one file at a time.

    The main disadvantage of '/solid' is the installer can possibly be slower because it takes longer to seek though one whole datablock of data looking for a file (though 'ReserveFile' can reserve files needed by the installer so that installer startup is quicker), where non /solid installers are generally quicker at seeking through the datablock as the files are separate entries.

    Generally the smaller the installer (compared to zlib), the longer it takes to compress. One advantage of lzma is it's fast decompression (installing files). In the real world, the main difference is compression speed vs installer size, the only difference you'll see in the installer is if it's run on a very slow computer.
    "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
    NSIS 3 POSIX Ninja
    Wiki Profile

    Comment


    • #3
      You have mentioned that decompression will be faster if lzma is used. But when i checked it practically by creating setup exe i found it takes more time to install.

      With nsis default compression(zlib) setup file was 60 MB.Time taken to install this setup is 40 sec.

      With lzma same setup file reduced to 40 MB.But time taken for installing this setup is 55 sec.

      So what is meant by faster decompression rate in case of lzma?

      Comment


      • #4
        It won't be faster than zlib of course, but for the considerably better compression ratio, the decompression speed isn't exponentially greater.

        I always use /solid lzma compression (with ReserveFile when necessary - note the compiler automatically inserts ReserveFile for plug-in calls). It is important for me that the output installer is as small as possible - even with today's "broadband" downloads will typically take longer than the actual installation process.

        Stu

        Comment


        • #5
          Originally Posted by winman2004 View Post
          You have mentioned that decompression will be faster if lzma is used. But when i checked it practically by creating setup exe i found it takes more time to install.

          With nsis default compression(zlib) setup file was 60 MB.Time taken to install this setup is 40 sec.

          With lzma same setup file reduced to 40 MB.But time taken for installing this setup is 55 sec.

          So what is meant by faster decompression rate in case of lzma?
          I meant the install speed in relation to it's compressed size, so in your example the size was reduced by 33.3% but the speed is 37.5% slower, so compared to it's size, lzma is actually slower by about 12.5% (the numbers don't lie so I guess I was given wrong information, or I'm comparing it to the latest 7zip software).

          In the real world no compression or zlib will always be the fastest, at the cost of huge installer sizes. If you're putting the installer on the internet, then smaller files are better at the cost of installer speed.
          "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
          NSIS 3 POSIX Ninja
          Wiki Profile

          Comment


          • #6
            In this link it is mentioned that


            "With solid compression, files are uncompressed to temporary file before they are copied to their final destination. With large installers, this might be a problem when it comes to required hard disk space"

            Does it mean the pc requires larger RAM or hard disk? My setup exe file is about 60 MB. So what will be the required RAM(if RAM is the considering point) to install it

            Comment


            • #7
              Disk, not memory
              IntOp $PostCount $PostCount + 1

              Comment


              • #8
                But how much disk usage it takes? Is that equal to size of setup when extracted?

                Comment


                • #9
                  Basically it means that during the install it will use twice as much disk space as the uncompressed files. This extra data (the temporary files that the /SOLID part creates) is automatically deleted when the installer is finished. I don't like using the /SOLID switch, but to each their own.
                  "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
                  NSIS 3 POSIX Ninja
                  Wiki Profile

                  Comment


                  • #10
                    Does it really use twice the size of uncompressed files? You have told twice size by including temp file and also installed file?
                    Or does it use twice the size of uncompressed files is %temp% alone?

                    Comment


                    • #11
                      Originally Posted by winman2004 View Post
                      Does it really use twice the size of uncompressed files? You have told twice size by including temp file and also installed file?
                      Correct. As an example, the file limit right now for nsis installers is 2GB. So if the installer was compressed with /SOLID, during the install it would require 4GB. When the install is finished it deletes the temp files (2GB), and the installed files remain (another 2GB).

                      Unless the users harddrive is really small, this extra space that's required generally doesn't cause problems (I haven't had a single problem with big installers using /SOLID, and I do a bit of testing).
                      "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
                      NSIS 3 POSIX Ninja
                      Wiki Profile

                      Comment


                      • #12
                        Thank you. I have implemented LZMA solid compression and it works fine.

                        Comment

                        Working...
                        X
                        😀
                        🥰
                        🤢
                        😎
                        😡
                        👍
                        👎