When to minify?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dhtml

    #16
    Re: When to minify?

    Douglas Crockford wrote:
    rf wrote:
    I highly recommend that you get Steve Sourders's book on performance.
    It's probably worthy of adding to the FAQ.

    --
    comp.lang.javas cript FAQ <URL: http://jibbering.com/faq/ >

    Comment

    • dhtml

      #17
      Re: When to minify?

      Jorge wrote:
      On Nov 15, 7:57 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
      wrote:
      >You don't serve large script files to mobile devices.
      >>
      >
      You don't know what you're talking about: The last iPhone webApp that
      I have written (not counting iui.js): 2256 lines of JavaScript, 64592
      characters -43286 characters minified (conservative setting) ->
      11561 bytes gzipped.
      >
      Minification alone shrinked it by 20k+.
      >
      >Anyhow, for 2 KiB that is
      >>
      >13.0 kbit/s on GSM, (...) etc etc
      >
      Mobile users don't get that speeds, those are (in theory) maximum
      speeds, nothing to do with what you really get.
      >
      Building into one file reduces the number of HTTP requests and adds one
      file into the cache (not 20 or so, which can easily happen when applying
      good old SRP).

      If the file is minified, it will take less room in the cache. Cache
      limits are finite. In mobile devices (like iPhone), cache is generally
      not as large as a desktop browser.

      Garrett


      --
      comp.lang.javas cript FAQ <URL: http://jibbering.com/faq/ >

      Comment

      • Thomas 'PointedEars' Lahn

        #18
        Re: When to minify?

        Jorge wrote:
        Thomas 'PointedEars' Lahn wrote:
        >You don't serve large script files to mobile devices.
        >
        You don't know what you're talking about: The last iPhone webApp that
        I have written (not counting iui.js): 2256 lines of JavaScript, 64592
        characters -43286 characters minified (conservative setting) ->
        11561 bytes gzipped.
        I happen to own an iPhone 3G. Its support includes EDGE and UMTS. What was
        your problem again?
        Minification alone shrinked it by 20k+.
        On EDGE (I'm not even talking about UMTS) that makes about 0.860+ s less --
        blink of an eye.

        That said, you don't even see the contradiction: cutting off 20k+ due to
        minimization from what, about 100k+ of code? And you are actually caring
        about mobile users? That's ridiculous.
        >Anyhow, for 2 KiB that is
        >>
        >13.0 kbit/s on GSM, (...) etc etc
        >
        Mobile users don't get that speeds, those are (in theory) maximum
        speeds, nothing to do with what you really get.
        13.0 kbit/s *is about* the transfer rate of (original) GSM (which is not
        very common anymore), channel splitting, syncing, bit error correction, and
        time slots already considered. You may be right about the other transfer
        rates, however even then the time difference would be negligible.

        And you still miss the point.


        PointedEars
        --
        Anyone who slaps a 'this page is best viewed with Browser X' label on
        a Web page appears to be yearning for the bad old days, before the Web,
        when you had very little chance of reading a document written on another
        computer, another word processor, or another network. -- Tim Berners-Lee

        Comment

        • Jorge

          #19
          Re: When to minify?

          On Nov 16, 6:46 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
          wrote:
          >
          That said, you don't even see the contradiction: cutting off 20k+ due to
          minimization from what, about 100k+ of code? And you are actually caring
          about mobile users? That's ridiculous.
          >
          That's ridiculous:

          "Cutting 30k by gzipping is allright, but cutting 20k+ by minifying
          isn't."

          duh!

          --
          Jorge.

          Comment

          • Jorge

            #20
            Re: When to minify?

            On Nov 16, 6:46 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
            wrote:
            >
            That said, you don't even see the contradiction: cutting off 20k+ due to
            minimization from what, about 100k+ of code?  And you are actually caring
            about mobile users?  That's ridiculous.
            >
            This is ridiculous:

            "Cutting 30k by gzipping is allright, but cutting 20k by minifying
            isn't."

            duh!

            --
            Jorge.

            "Silly things such as logic, common sense, rational
            thoughts or good manners are not allowed in this
            forum."

            Comment

            • Jason S

              #21
              Re: When to minify?

              As a regular user with a high-speed internet connection I don't care
              about minification.

              As a peek-under-the-hood user, I don't like minification.

              As a frugal owner of a website hosted by a pay-by-usage service
              (http://www.nearlyfreespeech.net/) I use gzip to keep my costs down &
              am aware of minification -- if my site usage goes up, it is an option
              that I will use to reduce costs.

              Comment

              • Michael Wojcik

                #22
                Re: When to minify?

                Jorge wrote:
                >
                This is ridiculous:
                >
                "Cutting 30k by gzipping is allright, but cutting 20k by minifying
                isn't."
                And how much larger is the file if you just gzip, and don't minify?
                Frequent strings of repeated spaces ought to find a pretty high place
                in the LZ table.

                Frankly, as a user who on occasion has to debug scripts on other
                people's pages (typically using Firebug) and fix them (generally with
                Greasemonkey-injected scripts of my own), I think "minifying" is
                damned obnoxious.

                I've never felt the need to read web pages, much less attempt to use
                ones with grandiose scripts, on a mobile device. If I did, I'd accept
                the limitations of the tools I chose to use. I don't expect my toolbox
                saw to cut as fast as my power compound mitre saw.

                But if you want to cater to the technophiles, that's your business.

                --
                Michael Wojcik
                Micro Focus
                Rhetoric & Writing, Michigan State University

                Comment

                • Jorge

                  #23
                  Re: When to minify?

                  On Nov 17, 9:32 pm, Michael Wojcik <mwoj...@newsgu y.comwrote:
                  Jorge wrote:
                  >
                  This is ridiculous:
                  >
                  "Cutting 30k by gzipping is allright, but cutting 20k by minifying
                  isn't."
                  >
                  And how much larger is the file if you just gzip, and don't minify?
                  Frequent strings of repeated spaces ought to find a pretty high place
                  in the LZ table.
                  >
                  Yes, Wojcik, that's a good question, because most UAs "Accept-
                  encoding: gzip" nowadays: these are the numbers:

                  ..js: 64592 chars.
                  ..js: 43286 chars. (minified).
                  ..js.gz: 14229 bytes. (gzipped).
                  ..js.gz: 11561 bytes. (minified + gzipped).

                  43286/11561 = 3.74
                  64592/14229 = 4.54

                  As you guessed, the several Ks of whiteSpace allow gzip() to get a
                  better compression ratio.

                  OTOH, the non-minified script that ends up into the browser's memory
                  still weights (unnecessarily) +20k more than the minified version:
                  IOW, it both takes longer to transmit and occupies 50% more memory
                  once received. Is it a "don't care" ? I don't think so. YMMV.

                  --
                  Jorge.

                  Comment

                  • Jorge

                    #24
                    Re: When to minify?

                    On Nov 17, 9:32 pm, Michael Wojcik <mwoj...@newsgu y.comwrote:
                    >
                    I've never felt the need to read web pages, much less attempt to use
                    ones with grandiose scripts, on a mobile device.
                    Yeah, but I'm talking about a webApp, not a page with some scripts.
                    You can't avoid big scripts with webApps, isn't it ?

                    --
                    Jorge.

                    Comment

                    • Gregor Kofler

                      #25
                      Re: When to minify?

                      Jorge meinte:
                      OTOH, the non-minified script that ends up into the browser's memory
                      still weights (unnecessarily) +20k more than the minified version:
                      IOW, it both takes longer to transmit and occupies 50% more memory
                      once received. Is it a "don't care" ? I don't think so. YMMV.
                      Indeed. Since my currently running FF occupies 280MB, I suppose the 20kB
                      (0.007% of 280MB) are negligible. As you said: YMMV.

                      Gregor

                      Comment

                      • Jorge

                        #26
                        Re: When to minify?

                        On Nov 18, 10:07 am, Gregor Kofler <use...@gregork ofler.atwrote:
                        Jorge meinte:
                        >
                        OTOH, the non-minified script that ends up into the browser's memory
                        still weights (unnecessarily) +20k more than the minified version:
                        IOW, it both takes longer to transmit and occupies 50% more memory
                        once received. Is it a "don't care" ? I don't think so. YMMV.
                        >
                        Indeed. Since my currently running FF occupies 280MB, I suppose the 20kB
                        (0.007% of 280MB) are negligible. As you said: YMMV.
                        >
                        Yeah, no need to gzip() either.

                        --
                        Jorge.

                        Comment

                        • Gregor Kofler

                          #27
                          Re: When to minify?

                          Jorge meinte:
                          On Nov 18, 10:07 am, Gregor Kofler <use...@gregork ofler.atwrote:
                          >Jorge meinte:
                          >>
                          >>OTOH, the non-minified script that ends up into the browser's memory
                          >>still weights (unnecessarily) +20k more than the minified version:
                          >>IOW, it both takes longer to transmit and occupies 50% more memory
                          >>once received. Is it a "don't care" ? I don't think so. YMMV.
                          >Indeed. Since my currently running FF occupies 280MB, I suppose the 20kB
                          >(0.007% of 280MB) are negligible. As you said: YMMV.
                          >>
                          >
                          Yeah, no need to gzip() either.
                          Nope - since we are talking about *transferring* either 60kB or 14kB.
                          Once on the client it won't make a difference.

                          Gregor

                          Comment

                          • Jorge

                            #28
                            Re: When to minify?

                            On Nov 18, 4:00 pm, Gregor Kofler <use...@gregork ofler.atwrote:
                            Jorge meinte:
                            >
                            On Nov 18, 10:07 am, Gregor Kofler <use...@gregork ofler.atwrote:
                            Jorge meinte:
                            >
                            >OTOH, the non-minified script that ends up into the browser's memory
                            >still weights (unnecessarily) +20k more than the minified version:
                            >IOW, it both takes longer to transmit and occupies 50% more memory
                            >once received. Is it a "don't care" ? I don't think so. YMMV.
                            Indeed. Since my currently running FF occupies 280MB, I suppose the 20kB
                            (0.007% of 280MB) are negligible. As you said: YMMV.
                            >
                            Yeah, no need to gzip() either.
                            >
                            Nope - since we are talking about *transferring* either 60kB or 14kB.
                            Once on the client it won't make a difference.
                            >
                            Gregor
                            I give up.

                            --
                            Jorge.

                            Comment

                            • Gregor Kofler

                              #29
                              Re: When to minify?

                              Jorge meinte:
                              I give up.
                              Victory, at last! The heinous empire of minifiers defeated.

                              Comment

                              • David Mark

                                #30
                                Re: When to minify?

                                On Nov 14, 11:32 am, Martin Rinehart <MartinRineh... @gmail.comwrote :
                                How much javascript would you have when you decide that minifying is
                                called for?
                                Why would it matter how much?

                                The answer to "when to minify" is: right before you start testing the
                                script. As mentioned, if your server supports HTTP compression, then
                                the "minificati on" is mostly a waste (might help with the odd agent
                                that declines GZIP.)

                                Comment

                                Working...