Bad performance sass compared to sassc
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
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.
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.
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.
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
Again, without knowing what your stylesheet looks like, we can't provide much information about why it's taking so much time to compile.