-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not compress the "same" as YUIcompressor #70
Comments
/sarcasm on The fact that for your specific css you find another tool doing a better job does not mean the claim is wrong. Feel free to do a proper test compressing various stylesheets and then you will be able to draw clear conclusions. |
@XhmikosR I'm not trying to be a jerk just trying to be precise. I'm of course incredibly grateful for this freely available tool. All I'm saying is that is probably better to say something like it "emulates" YUICompressor rather than "does the same job". I interpreted "does the same job" as the author having replicated the YUI Java application in Javascript. It is not about being better or worse, its just appears not to be the "same". |
Let's see what the Readme says again then.
As you can see, nowhere in the Readme is stated that Clean-css offers the same compression or better than YUI Compressor's CSS minifier. The same job means that its purpose/job is the same as YUI Compressor's CSS minifier and that it does that job faster due to node.js' V8 engine. Regardless, I'm personally very interested in some benchmarks if you are up to it. And the last time I brought this up, @GoalSmashers was interested too. |
I read "same job" as "same algorithm" though I think our interpretations are both clear now:
I'd be happy to include some benchmarks that show the Kb size output for Clean-css vs. YUIcompressor. I'm less concerned about how fast the compression occurs and wouldn't know how to do that benchmark. |
If #43 is implemented it would make things much easier to compare. I don't think there is a need to include those css files in the repository though. But I'll let @GoalSmashers comment more on this. |
What a heated discussion this is, @tim-peterson and @XhmikosR! :-) First of all "doing the same job" means stripping CSS out of any extra content. That's what both YUI and clean-css do. Implementation is different and that's the reason of different results. But the goal is to be as good as YUI or even better! Work is by no means finished! I think we should add a section in Readme / wiki page comparing both the speed and compression ratio. Both matter but compression ratio is something more important since 10 seconds saved on compression is nothing to 1GB/day saved on transfer. Although if you build frequently or on-the-fly then speed matters. @tim-peterson - please send a PR with both files (let's say in a new bench folder) and possibly with your custom CSS file if it's possible for you to share it. We'll do the rest! |
@GoalSmashers sounds good, give me until later today. I can give my custom CSS too since it'll be on the internet soon enough anyway when my site goes live. Facebook taught us that there is no point in hiding anything! :) |
Sure, please take your time. Looking forward to your custom CSS too. In the meanwhile I got my hands on yui-compressor 2.4.7 and compared it quickly to clean-css 0.10.1 on On my machine - MBP 2012 2.3 GHz w SSD it takes ~1.5s to minimize it using YUI (it's Java so quite understandable) and ~0.1s with clean-css. Here's the size comparison (both tools used with default options):
Clean-css wins by a narrow margin of 1kB although only 50 bytes after gzip compression (gzip -9). That's by no means a scientific verification but we will have it. |
And all of these makes me eager to look at your case! :-) |
@GoalSmashers Ok, simply updating Node by itself did the trick. My TP-demo.min.css file is now 244kb. For future users, here's a gist of how i updated my version of Node.. At the moment, I wasn't able to figure out how to use your command to update Clean-css:
Running the above, didn't give any errors, but when I went to use clean.css to minify my TP-demo.css file I got this error:
|
That's because commander is a new dependency in 0.10. |
So it got installed correctly but with wrong dependencies. Can you tell us what 'which cleancss' command tells you? Since npm has changed a lot since node 0.4 it may be some upgrade issue. On 21 Feb 2013, at 17:26, XhmikosR notifications@github.com wrote:
|
Thanks for the tip about upgrading npm. As soon as I did that ( So now i'm using node v0.9.10 and cleancss v0.10.1 and problem solved! Thanks for your help! p.s. i couldn't figure out how to get |
Great, you are welcome! On 21 Feb 2013, at 18:31, tim peterson notifications@github.com wrote:
|
The README states, "It does the same job as YUI Compressor's CSS minifier".
I found that the shrinking of my 355kb CSS file (which is largely comprised of Twitter Boostrap and jQueryUI) using YUI compressor shrinks it to 244kb but using Clean-CSS it only gets to 288kb. Both were done using the default settings.
Maybe not a major point but the README claim is not factual as far as I can tell.
The text was updated successfully, but these errors were encountered: