Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Sass compiles too slow in a fast development machine

My computer runs at 3.6ghz with 12gb of RAM, and uses Windows 7 and RailsInstaller for developing Rails apps.

Back when i used pure css, there was no issue, but when i started using Sass and Compass, i have to wait over 10-15 seconds when i refresh to see new changes. (that only happens when i edit a .scss file)

Anyone knows what causes this on a fairly fast machine?

like image 257
CodeOverload Avatar asked Nov 24 '12 23:11

CodeOverload


2 Answers

The sass compile times became significantly longer with the update from sass 3.1.x to 3.2.x.
There seems to be a specific concern as per Roman's response above, it's caused if you use @extend in deeply nested selectors since '@extend' does a lot of processing work. Here is the link to a currently open issue on the sass project on github for this exact problem.

That being said, the reports on that issue is more like 90-100 sec compile times (104sec for my own personal project that uses @extend alot to pull in foundation/bootstrap classes). So, if you're experiencing 9-10sec lags, yours might just be a general issue with the newest update being generally slower in compile times.

like image 163
Tonys Avatar answered Nov 03 '22 04:11

Tonys


In my case it was because of too frequent use of the @extend directive.

like image 35
Roman Pominov Avatar answered Nov 03 '22 04:11

Roman Pominov