Coder Social home page Coder Social logo

goalsmashers / css-minification-benchmark Goto Github PK

View Code? Open in Web Editor NEW
338.0 338.0 38.0 2.52 MB

A comparison of CSS minifiers for node.js

Home Page: https://goalsmashers.github.io/css-minification-benchmark/

License: MIT License

JavaScript 0.57% CSS 99.43%

css-minification-benchmark's People

Contributors

alexander-akait avatar army8735 avatar ben-eb avatar denji avatar dependabot[bot] avatar diegourban avatar dominikg avatar herrernst avatar jakubpawlowicz avatar lahmatiy avatar ludofischer avatar marek-saji avatar martijncuppens avatar nicolasbadia avatar onigoetz avatar semigradsky avatar shinnn avatar tavriaforever avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

css-minification-benchmark's Issues

Save results to an external file

I think we should improve the data generation and not generate the index.html file directly.

A few ideas for implementation:

  1. Use XHR and load the bench data
  2. Inline the data via Jekyll includes; maybe in an array or something

Either way, this should allow us to do more on the frontend part, add a GitHub ribbon maybe, add more info about the system the bench last run, add the gzip bench too and so on.

--total overflow table

In some tests --total undefined:
      activeMinifiers.forEach(function(minifier) {
        minifier.total = storage.total(minifier.name);
      });

total_table_overflow

New CSS minifier: miniMinifier

Hello, I'd like to add my css minifier to the list, but sadly it's not node based. it's just an experiment (I tried to make a minifier as short as possible), but it has very interesting results:

given a string to minify "str", just run:

for(i=9;i--;)str=str.replace(/^\s|\s$|\/\*[^]*?\*\/|\s*;*([^\:\w.#\x27"\s*-])\s*|(:) /g,"$1$2")

(removes comments, whitespaces and semicolons)

or a little more complete:

for(i=9;i--;)str=str.replace(/([^#\d\w\(._\x27"-])((0)[a-z%]+|0(\.))|^\s|\s$|\/\*[^]*?\*\/|\s*;*([^\:\w.#)\x27"\s*-])\s*|\s(\))|(:) |[^}]*{}/gi,"$1$3$4$5$6$7").replace(/rgb\((\d+),(\d+),(\d+)\)|#[a-f0-9]{6}/gi,function(a,c,d,b){if(b)for(i in a="#",p=[c,d,b])a+=("0"+parseInt(p[i]).toString(16)).slice(-2);return(p=a[2]+a[4]+a[6])==a[1]+a[3]+a[5]?"#"+p:a})

(removes comments, whitespaces and semicolons, leading zeros, units after zero, empty rules, converts rgb colors to hex and preserve ie8 compatibility)

You'll find more info, demo and test files on: http://xem.github.io/miniMinifier/css/

If someone can help me convert this / those functions in node, that would be very nice.
(I don't know how to do it yet ^^)

Thanks!

Add info below table

E.g. I think that most grunt-contrib-cssmin users don't know that it uses clean-css. It would make sense to provide this and related info below the table, so that visitors can have an immediate (broad) understanding of in which projects these minifiers are used.

Add compilation duration

It would be great to have the compilation duration too.
We could have big differences there...

Add date to the test page

It would be good to know at which date the tests were created.
Right now I have no way to actually know if he comparison table was made far in the past or recently, because It is very tedious to track down each package version and compare it to the the benchmark's one. This will provide a very basic way to know if the tests are still relevant or not.

Clean up data used

@GoalSmashers: using already minified CSS like facebook, youtube etc doesn't show the real improvements.

I suggest we remove those and add better cases in their place.

Normalize data

Restore the data files to their original state without touching any comments.

Mention in readme that we use the default options and as such some optimizers might keep the comments some not. Alternatively, we should keep only the important comments in clean-css which should match what csso, cssnano and csswring do by default. I'm leaning towards the second solution.

/CC @jakubpawlowicz

Move index.html into docs

@jakubpawlowicz I'll make a PR but you will need to change the repo setting to use the master/docs folder.

Then I will add a .nojekyll file and this way we separate code and docs. The default branch should be master then, and gh-pages can be deleted.

I'll make a PR and ping you to make the changes

Create a gh-pages for the results

Since GitHub has this very useful feature, I think we should use it in this case.

It should be pretty easy to set up things; just rename the master branch to gh-pages.

Or alternatively, we could make a gh-pages branch in clean-css' repository. I think this makes more sense and there isn't any need for a separate repository.

What do you think @GoalSmashers?

update cssnano to 3.2.0

Being built on postcss, I'm guessing that this library will get faster/better and would like to keep track of its performance progress.

Respect the OS line endings

results.html always has LF line endings which is causing issues on Windows.

Can't we use writeFileSync or something similar to write results.html?

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.