When compiling sass I tend to have very long compilation times (up to 9 seconds on the current mid-scale project) on my otherwise very fast laptop with an ssd. I'm using sass via grunt-contrib-sass ass a grunt task, but the compilation times don't differ much when running sass directly from the command line. Libsass on the other hand just needs around 100ms for the same project, but it doesn't support several features I need. So I would like to know what possibilities I have to speed up the compilation process?
Splitting up files helps of course, but are there other ways to do so with less side-effects?
Edit: In addition I would be also glad for an explanation how libsass could so much faster than ruby-sass. Somehow I highly doubt that it is just because ruby is so much slower than C/C++. Or am I wrong here?
Edit2: While I'm using Ubuntu, the same project is compiled in 2 seconds on a macbook pro, which is supposed to be slower, when it comes to the hardware, so this might be related to linux somehow.
What I've found out so far:
Only grunt related:
update-autoprefixer: If you're using grunt-autoprefixer then I strongly suggest you to update it to the newest version (1.0.0 atm). I had a spead increase from 13 to 4 seconds in one of my projects. The update also fixes the broken source maps issue.
use jit-grunt instead of load-grunt-tasks: If you're using grunt-load-tasks consider using jit grunt instead. There is a significant speed increse.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With