Skip to content
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

Significant Performance decrease between 3.0.3 and 4.0.0 #98

Open
MobiusHorizons opened this issue Mar 29, 2016 · 11 comments
Open

Significant Performance decrease between 3.0.3 and 4.0.0 #98

MobiusHorizons opened this issue Mar 29, 2016 · 11 comments

Comments

@MobiusHorizons
Copy link

I Manage a gulp build process that runs sass through bless.
The build process was taking ~7 seconds using gulp-bless v3.0.1 and bless 3.0.3.
I upgraded today to gulp-bless 3.10 which includes bless 4.0.0, and build times went up from ~7s to 93s.

Obviously this is completely unacceptable.

I suppose the problem could lie with gulp-bless, but i don't know how to test that.

@DrEnter
Copy link

DrEnter commented Apr 18, 2016

Can attest to seeing exactly the same issue using grunt-bless 1.0.2 / bless-4.0.2 so I don't think it's a gulp-bless issue.

@AaronAsAChimp
Copy link
Member

After profiling it seems to be a bad interaction between Marak/colors.js and reworkcss/css as documented in reworkcss/css#88, a workaround would be to run blessc with the --no-color option.

@mtscout6
Copy link
Member

mtscout6 commented Apr 20, 2016

I'm curious how Chalk would do, it has better cross platform support and doesn't modify the String prototype. Pull requests are welcome.

@MobiusHorizons
Copy link
Author

@mtscout6 sounds like it could help, I may have some time to look at this again, if I do, I'll try that route.

@w0rp
Copy link

w0rp commented Aug 2, 2016

I would like to note that this is still an issue if you are using grunt-bless. If you try creating a large CSS file which will be split up into three smaller files with grunt-bless, and compare the time taken with bless before and after, grunt-bless@0.2.0 is much faster than grunt-bless@1.0.2. Here are some times from my codebase, for each version, including the time taken to start up grunt, which is around 5 seconds.

With grunt-bless version 0.2.0: (bless version 3 or so)

real  0m5.627s
user  0m5.436s
sys   0m0.252s

With grunt-bless version 1.0.2: (bless version 4 or so)

real  0m29.497s
user  0m29.360s
sys   0m0.452s

@mtscout6
Copy link
Member

mtscout6 commented Aug 2, 2016

The update with the change to chalk was in 4.0.4. Are you testing with that version?

@w0rp
Copy link

w0rp commented Aug 2, 2016

I believe I should be. I cleanly installed from npm again and grunt-bless seems to be set to ~4.0.0.

https://github.com/BlessCSS/grunt-bless/blob/master/package.json#L40

@AaronAsAChimp
Copy link
Member

You can confirm the version by running:

$ npm list bless

If you could also try running blessc directly. It should help us narrow in on the issue.

@w0rp
Copy link

w0rp commented Aug 2, 2016

Sure. I'll find the file I was testing this against a little later and see if I can get a similar speed out of blessc directly. Maybe I can also create an example file I can share.

@w0rp
Copy link

w0rp commented Aug 2, 2016

I was able to run bless on the file via blessc directly, and it executed quite quickly. I don't have experience with the NodeJS profiling tools to see where the issue lies, but I believe the issue might actually lie in grunt-bless, and not in bless itself. It's hard to tell. All I know is, grunt-bless on version 0.2.0 executes much more quickly.

I unfortunately probably cannot share the CSS file I am using. I imagine any file large enough to be split into two files will do, though.

@AaronAsAChimp
Copy link
Member

It appears to be the same culprit, if any dependency brings in colors.js you'll see a degradation of performance. In this case Grunt (via grunt-legacy-log) uses the library.

Unfortunately moving to chalk only mitigates the problem. The responsibility for fixing this issue lies with ReworkCSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants