Asset precompile seems significantly slower #25

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

Comments

Projects
None yet
3 participants
Contributor

chrisnicola commented Feb 6, 2012

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

Contributor

chrisnicola commented Feb 7, 2012

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

Contributor

chrisnicola commented Feb 7, 2012

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

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.

Contributor

chrisnicola commented Feb 7, 2012

You need to import both though right?

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 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 commented Mar 26, 2012

It would appear that it's related to chriseppstein/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" .

Contributor

chrisnicola commented Apr 4, 2012

The fix to nex3/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 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.

Contributor

chrisnicola commented Apr 4, 2012

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 chrisnicola closed this Apr 4, 2012

Contributor

chrisnicola commented Apr 4, 2012

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

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