GithubHelp home page GithubHelp logo

Comments (8)

rwaldron avatar rwaldron commented on June 24, 2024

grunt-compare-size didn't tell jQuery to reuse a an array of file paths... we (jQuery) just did that. https://github.com/jquery/jquery/blob/master/Gruntfile.js#L21-L22 We could just make this it's own list? Or only .js?

from grunt-compare-size.

rwaldron avatar rwaldron commented on June 24, 2024

The more I think about it, the more I actually hate both the jQuery list re-use and the grunt-compare-size assumption that the list item in the list is the gzip item.

from grunt-compare-size.

dmethvin avatar dmethvin commented on June 24, 2024

Yeah i know what you're saying. I would actually be happier if we just reported the gzip size of the min.js file in a one-line compact format, at least that would be short.

from grunt-compare-size.

gibson042 avatar gibson042 commented on June 24, 2024

I'd like to address this by accepting a compressor function in the task options and sending all files through it; output would look something like:

Sizes
  9363   gz:2895 tasks/compare-size.js                                          
  2687   gz:1139 dist/source.js                                                 
   305    gz:208 dist/source.min.js                                             

Compared to last run
    -4     gz:-3 tasks/compare-size.js                                          
     =      gz:= dist/source.js                                                 
     =      gz:= dist/source.min.js

@dmethvin, @rwldrn: thoughts?

from grunt-compare-size.

dmethvin avatar dmethvin commented on June 24, 2024

I'd like to see a more compact format. How about this?

Sizes     Diff
  9363     -4    gz:2895 tasks/compare-size.js                                          
  2687      =    gz:1139 dist/source.js                                                 
   305      =    gz:208 dist/source.min.js                                             

Also the thing where it compared the size to every branch you have locally was waaaaay too verbose for the case where you're landing lots of other people's stuff. I was getting two screens full of diff info and having to blow away the branch .sizecache often. Perhaps it could use an activity (last commit) date to avoid spamming the console. Or we could just show the min/gz number since that's all we care about on the other branches?

from grunt-compare-size.

gibson042 avatar gibson042 commented on June 24, 2024

Multiple branch verbosity is a separate issue (literally so: gh-15), but regarding this, don't we want size comparisons against both uncompressed and gzipped versions of the files? In jQuery's case it'll be three lines per entry:

Compared to last run
    -4     gz:-3 dist/jquery.js
    -1     gz:-1 dist/jquery.min.js

Edit: plus three lines for "Sizes", which I now realize is probably what you're trying to avoid:

Sizes
235540  gz:69653 dist/jquery.js
 82725  gz:29538 dist/jquery.min.js

from grunt-compare-size.

dmethvin avatar dmethvin commented on June 24, 2024

Yeah, that looks more compact. We could remove the gz: prefix and just make column headers to save a bit more.

from grunt-compare-size.

scottgonzalez avatar scottgonzalez commented on June 24, 2024

For reference, this is what the Closure Compiler UI shows:

Original Size:  13.54KB (4.3KB gzipped)
Compiled Size:  6.18KB (2.32KB gzipped)
Saved 54.33% off the original size (46.03% off the gzipped size)

Which is probably closer to what @dmethvin wants (values spread across columns instead of rows).

from grunt-compare-size.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.