Skip to content

Commit

Permalink
Stop benchmarking Ruby Sass
Browse files Browse the repository at this point in the history
We already know it's way slower than any other implementation,
it's reached end-of-life, and it slows down the process of running
benchmarks significantly.
  • Loading branch information
nex3 committed Jul 17, 2019
1 parent c794abd commit d6aa4c2
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions tool/grind/benchmark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,18 @@ benchmark() async {
environment: {"SASS_LIBSASS_PATH": p.absolute(libsass)}));
log("");

var ruby = await cloneOrPull('https://github.com/sass/ruby-sass');
log("");

var libsassRevision = await _revision(libsass);
var sasscRevision = await _revision(sassc);
var dartSassRevision = await _revision('.');
var rubySassRevision = await _revision(ruby);
var gPlusPlusVersion = await _version("g++");
var nodeVersion = await _version("node");
var rubyVersion = await _version("ruby");

var perf = File("perf.md").readAsStringSync();
perf = perf.replaceFirst(RegExp(r"This was tested against:\n\n[^]*?\n\n"), """
This was tested against:
* libsass $libsassRevision and sassc $sasscRevision compiled with $gPlusPlusVersion.
* Dart Sass $dartSassRevision on Dart $dartVersion and Node $nodeVersion.
* Ruby Sass $rubySassRevision on $rubyVersion.
""");

Expand Down Expand Up @@ -197,18 +191,13 @@ I ran five instances of each configuration and recorded the fastest time.
await _benchmark("node", [p.join('build', 'npm', 'sass.js'), path]);
buffer.writeln("* Dart Sass on Node.js: ${_formatTime(nodeTime)}");

var rubyTime = await _benchmark(
"ruby", ["-I", p.join(ruby, 'lib'), p.join(ruby, 'bin', 'sass'), path]);
buffer.writeln("* Ruby Sass with a hot cache: ${_formatTime(rubyTime)}");

buffer.writeln();
buffer.writeln('Based on these numbers, Dart Sass from a native executable '
'is approximately:');
buffer.writeln();
buffer.writeln('* ${_compare(nativeExecutableTime, sasscTime)} libsass');
buffer.writeln(
'* ${_compare(nativeExecutableTime, nodeTime)} Dart Sass on Node');
buffer.writeln('* ${_compare(nativeExecutableTime, rubyTime)} Ruby Sass');
buffer.writeln();
log('');
}
Expand Down Expand Up @@ -236,8 +225,8 @@ Future<String> _version(String executable) async =>
Future<Duration> _benchmark(String executable, List<String> arguments) async {
log("$executable ${arguments.join(' ')}");

// Run the benchmark once without recording output to give Ruby Sass a hot
// cache and give other implementations a chance to warm up at the OS level.
// Run the benchmark once without recording output to give implementations a
// chance to warm up at the OS level.
await _benchmarkOnce(executable, arguments);

Duration lowest;
Expand Down

0 comments on commit d6aa4c2

Please sign in to comment.