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

It's twice slower then node-sass #206

Closed
FDiskas opened this issue Dec 21, 2017 · 4 comments
Closed

It's twice slower then node-sass #206

FDiskas opened this issue Dec 21, 2017 · 4 comments

Comments

@FDiskas
Copy link

FDiskas commented Dec 21, 2017

Please check this simple example
test.zip
Reproduce:

  1. yarn
  2. yarn dart
  3. yarn node

Or using NPM:

  1. npm install
  2. npm run dart
  3. npm run node

Using gnomon
https://i.imgur.com/nSAJo1L.png

Or using time
https://i.imgur.com/C7dXcif.png

@nex3
Copy link
Contributor

nex3 commented Jan 3, 2018

We're aware of the performance differences; we track performance in this file and we have #113 open to improve speed in JS. It's also worth noting a few general things about performance:

  • Node Sass is a wrapper for LibSass, which is written in C. Dart Sass (as distributed on NPM) is pure JavaScript. C is almost always going to be faster than pure JavaScript. Getting within 2-3x speed is pretty impressive, all things considered.

  • Running Dart Sass from Dart will also always be faster than running it from JavaScript, because the Dart VM is faster than the JavaScript VM (for various reasons that are tangential to this discussion). You can try this yourself by downloading the Dart release from the releases page.

  • Our benchmarks have generally indicated that Dart Sass from Dart tends to be about the same speed or slightly faster than LibSass, due to algorithmic improvements. If speed is your primary concern and you don't need to define custom functions or importers in JavaScript, I'd recommend using that.

Addendum:

  • If you're interested in a fast implementation that's easy to install via npm, I've outlined a possible plan for that in Add an embeddable execution mode #248. However, in order to make this work, I need someone who's willing to develop a JS wrapper that communicates with a Dart executable using protocol buffers or a similar high-speed protocol. If you're interested in helping out with this, comment on Add an embeddable execution mode #248.

@nex3 nex3 closed this as completed Jan 3, 2018
@halfnibble
Copy link

dart-sass finally supports all the features I am using with version 1.13.2. But my Sass/CSS build must be complicated because it takes about 46 seconds, or 6.5x longer. :(

@nex3
Copy link
Contributor

nex3 commented Sep 10, 2018

@halfnibble If you can provide a stylesheet that's that much slower to compile in JS than it is in the Dart VM, that would be helpful for our optimization efforts.

@FDiskas
Copy link
Author

FDiskas commented Sep 11, 2018

As a comparison I prefer to use bootstrap as example.

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

No branches or pull requests

3 participants