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

Asset precompile seems significantly slower #25

Closed
chrisnicola opened this issue Feb 6, 2012 · 12 comments
Closed

Asset precompile seems significantly slower #25

chrisnicola opened this issue Feb 6, 2012 · 12 comments
Assignees

Comments

@chrisnicola
Copy link
Contributor

I have not been able to ascertain what the exact cause is but including both compass_bootstrap_twitter and compass_bootstrap_twitter_responsive seems to have an extraordinarily long compile time. Much longer than pre-2.0. I'm going to run some tests to see if it is just the responsive part or the core part.

@ghost ghost assigned vwall Feb 7, 2012
@chrisnicola
Copy link
Contributor Author

Just did a quick test, definitely faster with the responsive import left out.

@chrisnicola
Copy link
Contributor Author

Could be related to this issue:
Compass/compass#516

@vwall
Copy link
Owner

vwall commented Feb 7, 2012

Yea if you switch it to import just the responsive it's fine. When you import both it slows down. Also looking into this.

@chrisnicola
Copy link
Contributor Author

You need to import both though right?

@vwall
Copy link
Owner

vwall commented Feb 7, 2012

Yes. Just mean it's not something in the responsive.scss file as far as I can tell. Digging into compass and sass to see where the problem is.

@michaek
Copy link

michaek commented Mar 26, 2012

I don't know where in the codebase this is happening, but importing compass_twitter_bootstrap makes my asset compilation much slower. Without, my CSS compiles in about 4 seconds; with, it takes about 13 seconds.

  • ruby 1.9.2
  • rails (3.2.2)
  • compass (0.12.1)
  • compass-rails (1.0.1)
  • compass_twitter_bootstrap (2.0.1.2)

@michaek
Copy link

michaek commented Mar 26, 2012

It would appear that it's related to Compass/compass#516 , as the CSS generation is very fast using compass compile - it's only slow in the assets pipeline. For now, I'm going to use compass watch with css_dir = "public/assets" .

@chrisnicola
Copy link
Contributor Author

The fix to sass/sass#337 actually fixes this completely for me. Just found it.

You'll need to use the master branch in your Gemfile.

  gem 'sass', git: 'git://github.com/nex3/sass.git'

@michaek
Copy link

michaek commented Apr 4, 2012

That does seem to speed things up, but compilation through the assets pipeline is stil ~4 times slower than compass compile.

@chrisnicola
Copy link
Contributor Author

The asset pipeline does more than what compass compile is doing by itself as I understand. First it's compiling gzipped versions as well as uncompressed versions. It is also parsing the files looking for rails specific directives like "image_url" and stuff.

If you don't mind checking compiled assets into your code base then it's always going to be faster to use compass. I'm deploying to Heroku so my main concern was deployment times since Heroku runs the compile task. I also don't like checking compiled files of any kind into source control. Too much noise in the change logs.

@chrisnicola
Copy link
Contributor Author

Closing this issue, since it appears to be largely fixed and has nothing to do with compass_twitter_bootstrap anyways.

@michaek
Copy link

michaek commented Apr 4, 2012

I agree with you on the asset pipeline doing more, but including compass_twitter_bootstrap takes me from 1.6 seconds to 5.0 seconds (compiling with the asset pipeline). That's not necessarily relevant to this issue, but it does mean that this library is a lot slower than, say, Compass itself.

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

3 participants