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 benchmark #41

Closed
DarkPark opened this issue Jan 6, 2016 · 8 comments
Closed

bad benchmark #41

DarkPark opened this issue Jan 6, 2016 · 8 comments

Comments

@DarkPark
Copy link

DarkPark commented Jan 6, 2016

node bin/benchmark.js

gives

Error: Cannot find module '../dist/sass.min.js'

and there is really no such file
so I've corrected it to sass.js and got this:

sass.js: 
node-sass: 
Fastest is 
@rodneyrehm
Copy link
Member

I wasn't aware this benchmark thingie still existed. you'd have to use sass.sync.js, though

@DarkPark
Copy link
Author

DarkPark commented Jan 6, 2016

ok
corrected require statement to sass.sync.js
output is the same

@rodneyrehm
Copy link
Member

Fixed the simple benchmark thingie… thx for the pointer :)

➜  node bin/benchmark.js
sass.js x 13,352 ops/sec ±1.38% (79 runs sampled)
node-sass x 15,768 ops/sec ±1.64% (76 runs sampled)
Fastest is node-sass

@rodneyrehm
Copy link
Member

uhm… those results can't be correct, right? that would mean the emscripted library is almost as fast as the native binding… huh?

@rodneyrehm rodneyrehm reopened this Jan 23, 2016
@DarkPark
Copy link
Author

That was the idea behind Emscripten LLVM-to-JavaScript compiler :)
Seems it's a very good compiler.

@rodneyrehm
Copy link
Member

The benchmark was reading the file, but not converting it to string. What it was testing is the input error handling, instead of the compiler.

➜  node bin/benchmark.js
sass.js x 22.61 ops/sec ±37.39% (67 runs sampled)
node-sass x 183 ops/sec ±1.21% (81 runs sampled)
Fastest is node-sass

That makes node-sass about 9x faster than sass.js.

@DarkPark
Copy link
Author

rather big difference
according to this benchmark pure js LESS implementation is only twice slower than libsass

@rodneyrehm
Copy link
Member

These benchmarks don't compare. bin/benchmark.js is basically running the same C++ code once via the native binding, once via emscripten. LESS is a completely different code base.

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

2 participants