Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad performance sass compared to sassc #1161

Open
matiskiba opened this issue Dec 12, 2020 · 5 comments
Open

Bad performance sass compared to sassc #1161

matiskiba opened this issue Dec 12, 2020 · 5 comments

Comments

@matiskiba
Copy link

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

@jathak
Copy link
Member

jathak commented Dec 16, 2020

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.

@nex3
Copy link
Contributor

nex3 commented Dec 17, 2020

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.

@matiskiba
Copy link
Author

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
Copy link
Author

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

@nex3
Copy link
Contributor

nex3 commented Jan 5, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants