Every time I make a change to my SASS in development, I get 20s+ load times when loading my application.css
.
I've read some other questions, and tried:
- Setting
config.assets.debug = false
. - Changing up imports and requires (I use SASS variables)
- Using Miniprof and its firegraph
- Using rails-asset_profile
Here's what I read:
- Rails Asset Pipeline/Compass/SASS extremely slow to compile in development mode
- Slow assets compilation in development mode
- rake assets:precompile taking extremely long to complete
I've been having this issue from Rails 3.2 and now in 4.2.
I'm going crazy here. How do I find the bottleneck in this mess?
I am looking for a solution that allows me to pinpoint with precision where the time is spent and suggests ways to cut down on that compilation time.
.css.erb
files and puts statments. just to get any reference points – phoet@import
statements, you will seriously slow things down if you have a lot of CSS code, since on every change SASS will have to recompile everything, and not just a single file. I happened to encounter this scenario earlier this week, and usingrequire
instead of@import
solved this; I created a separatevariables.css.sass
file to store variables & mixins (which is@import
ed in every SASS file). – Martin Tournoij