[Performance] Strange super slow speed on certain files.
See original GitHub issueThanks for this awesome project! This really help CDNJS minify the css assets easily!
I just found that clean-css will be super super slow when compressing some files, especially the css files in Google’s material-design-icons project, it’ll spend more then 10 minutes on a single css file which looks abnormal.
This is my environments: node versions : v4.5.0 / 6.3.1 / 6.5.0 and some others … clean-css versions : v3.4.10 / 3.4.19 and some others … platform : Ubuntu 14.04.5 (also tried on Arch Linux)
There are some of the files with performance issue: https://github.com/google/material-design-icons/blob/3.0.1/sprites/css-sprite/sprite-av-black.css https://github.com/google/material-design-icons/blob/3.0.1/sprites/css-sprite/sprite-action-black.css
The size of those files are not so huge:
-rw-r--r-- 1 peter peter 108503 Sep 2 08:32 sprite-av-black.css
-rw-r--r-- 1 peter peter 185707 Sep 2 08:32 sprite-action-white.css
The lines of codes in that two css files:
5197 sprite-av-black.css
8904 sprite-action-black.css
The parameters I’m using:
--compatibility --s0
But remove all the parameters didn’t help at all.
Do you guys have any idea about that? Many thanks!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:5
Top GitHub Comments
Great. Thanks for bringing this performance regression into my attention.
Hi @PeterDaveHello, glad clean-css works well for you!
I’ve just tested both files and that slow down is related to the most time consuming advanced optimizations: restructuring. In case of those files it tries to reorganize the whole CSS file, see examples here: https://github.com/jakubpawlowicz/clean-css/blob/master/test/selectors/restructure-test.js
I recommend you turn it off using
--skip-restructuring
in case of those files. There’s a ticket to refactor said optimization as it’s currently way too complex: #533.