mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-21 21:31:11 +01:00
Don't check in benchmark sources.
This commit is contained in:
parent
4a592e18eb
commit
3ccd8f31ad
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,3 +7,4 @@ build/
|
||||
packages
|
||||
.packages
|
||||
pubspec.lock
|
||||
/benchmark/source
|
||||
|
31
benchmark/generate.dart
Executable file
31
benchmark/generate.dart
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env dart
|
||||
// Copyright 2016 Google Inc. Use of this source code is governed by an
|
||||
// MIT-style license that can be found in the LICENSE file or at
|
||||
// https://opensource.org/licenses/MIT.
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'dart:math' as math;
|
||||
|
||||
main() async {
|
||||
var sources = new Directory("benchmark/source");
|
||||
if (!await sources.exists()) await sources.create();
|
||||
|
||||
await writeNTimes("${sources.path}/small_plain.scss", ".foo {a: b}", 4);
|
||||
await writeNTimes("${sources.path}/large_plain.scss", ".foo {a: b}", math.pow(2, 17));
|
||||
await writeNTimes("${sources.path}/preceding_sparse_extend.scss", ".foo {a: b}", math.pow(2, 17), header: '.x {@extend .y}', footer: '.y {a: b}');
|
||||
await writeNTimes("${sources.path}/following_sparse_extend.scss", ".foo {a: b}", math.pow(2, 17), header: '.y {a: b}', footer: '.x {@extend .y}');
|
||||
await writeNTimes("${sources.path}/preceding_dense_extend.scss", ".foo {a: b}", math.pow(2, 17), header: '.bar {@extend .foo}');
|
||||
await writeNTimes("${sources.path}/following_dense_extend.scss", ".foo {a: b}", math.pow(2, 17), footer: '.bar {@extend .foo}');
|
||||
}
|
||||
|
||||
Future writeNTimes(String path, String text, int times, {String header, String footer}) async {
|
||||
print("Generating $path...");
|
||||
var file = new File(path).openWrite();
|
||||
if (header != null) file.writeln(header);
|
||||
for (var i = 0; i < times; i++) {
|
||||
file.writeln(text);
|
||||
}
|
||||
if (footer != null) file.writeln(footer);
|
||||
await file.close();
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,4 +0,0 @@
|
||||
.foo {a: b}
|
||||
.foo {a: b}
|
||||
.foo {a: b}
|
||||
.foo {a: b}
|
Loading…
x
Reference in New Issue
Block a user