vwall / compass-twitter-bootstrap

The twitter bootstrap ported to compass
722 stars 119 forks source link

Asset precompile seems significantly slower #25

Closed chrisnicola closed 12 years ago

chrisnicola commented 12 years ago

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.

chrisnicola commented 12 years ago

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

chrisnicola commented 12 years ago

Could be related to this issue: https://github.com/chriseppstein/compass/issues/516

vwall commented 12 years ago

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 commented 12 years ago

You need to import both though right?

vwall commented 12 years ago

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 12 years ago

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.

michaek commented 12 years ago

It would appear that it's related to https://github.com/chriseppstein/compass/issues/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 commented 12 years ago

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 12 years ago

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

chrisnicola commented 12 years ago

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 commented 12 years ago

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

michaek commented 12 years ago

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.