joliss / broccoli-sass

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

renderSync => render #58

Open chriseppstein opened 9 years ago

chriseppstein commented 9 years ago

As I understand it, broccoli prefers synchronous file i/o for performance reasons. But I don't think that broccoli should use node-sass's renderSync method. Instead, I think it should use the async render method. We need to run several hundred sass compiles per build (number of sass files times the number of locale's we support) and this should help with throughput.

@stefanpenner tells me this is very doable, but I have forgot the specifics.

If there's no objection, I can work on a patch with a few code pointers.

joliss commented 9 years ago

Yeah that's fine and definitely possible - just return a promise from updateCache. A patch would be awesome. Can you post before/after timings as well?

As for style, you might know this already but RSVP.denodeify often helps with making callback-based code look pretty. :)

chriseppstein commented 9 years ago

Can you post before/after timings as well?

timings of what? The tests?

joliss commented 9 years ago

No such "tests" ;-)

I mean timing of some non-trivial app that you have, that you're trying to speed up. (The sole motivation for this is performance, correct?)

stefanpenner commented 9 years ago

No the motivation is to enable sass plugins and ecosystem to have async

joliss commented 9 years ago

Oh, OK, that sounds great. Never mind then, no timings needed.