dart-sass icon indicating copy to clipboard operation
dart-sass copied to clipboard

Bad performance sass compared to sassc

Open matiskiba opened this issue 5 years ago • 7 comments

Hello,

Since the deprecation of libsass I'm looking into transitioning to dart sass. For that I'm looking into performance issues. I've encountered a case where sassc takes 200ms compared to libsass taking 2s. Is that interesting for you? should I post the files? (there are many files in this use case)

King regards, Mati

matiskiba avatar Dec 12 '20 01:12 matiskiba

What method did you use to install Dart Sass? If you're using NPM, you're getting the compiled-to-JS version, which has an unavoidable performance hit, but if you've installed it through some other method (the standalone release on GitHub, Homebrew, Pub, etc), this is something we could take a look at.

jathak avatar Dec 16 '20 18:12 jathak

It's worth noting that 2s versus 200ms is a much larger performance hit than we'd expect, but much of that may be caused by details like how you're running Sass. As @jathak says, to provide you with more help we need a lot more information about how you installed Sass, how you're running it, and what your CSS looks like.

nex3 avatar Dec 17 '20 11:12 nex3

I've downloaded the release dart-sass-1.32.0-linux-x64.tar.gz Ran the following commands

#1: time sass --update ../test.scss -I /var/www/cp/xsites_versions/connector_js_mati > res.css #2: time sassc ../test.scss -I /var/www/cp/xsites_versions/connector_js_mati > res.css

The timings of sass are: "user" avg 450-500ms The timings of sassc are: "user" avg 250ms

So about x2 performance hit.

matiskiba avatar Jan 05 '21 17:01 matiskiba

Update: I ran the dart sass command line wrongly. This is the relevant command: #1: time sass ../test.scss -I /var/www/cp/xsites_versions/connector_js_mati res.css

And this is the output: real 0m2.140s user 0m3.100s sys 0m0.104s

A 10x performance hit

@nex3 @jathak

matiskiba avatar Jan 05 '21 18:01 matiskiba

Again, without knowing what your stylesheet looks like, we can't provide much information about why it's taking so much time to compile.

nex3 avatar Jan 05 '21 23:01 nex3