joliss / broccoli-sass

Sass compiler for Broccoli, using libsass
MIT License
44 stars 97 forks source link

Use broccoli-caching-writer. #28

Closed rwjblue closed 10 years ago

rwjblue commented 10 years ago

Even though libsass is insanely fast, we still see broccoli-sass in the "slow-trees listing" (at around 250ms) for every rebuild regardless of what files were changed.

This change updates to inherit from broccoli-caching-writer, which simply symlinks (using symlink-or-copy package) from the last runs cache directory if the input trees have not changed.

The result of this is that when changing files in a tree other than those provided to broccoli-sass the broccoli-sass tree rebuilds are nearly instant ( less than 10ms on SSD ).

In the future, we can even restrict extraneous rebuilds further by using broccoli-caching-writer's new include/exclude patterns to prevent cache invalidation when files inside the inputTrees but not related to the sass compilation are changed.

Closes #26.

rwjblue commented 10 years ago

I have confirmed that this works properly when used within an ember-cli app (just used an ember-cli app as a test bed, this PR does not require ember-cli or anything).

dschmidt commented 10 years ago

@rwjblue asked me to post my test results: In my setup (Linux, SSD with rather slow processor) my build times dropped from ~450-650ms to not visible up to ~130ms, while initial builds havent changed as far as I can tell.

Also as expected: if I change a .sass file, compile times are "back to normal".

rwjblue commented 10 years ago

@joliss - Please review, when you have a moment.

joliss commented 10 years ago

Thanks, released in v0.2.3.