Skip to content

Commit e4c8b49

Browse files
munificentCommit Queue
authored andcommitted
Format benchmarks/.
Change-Id: I1362ada67a02b0ed352612fc29c727e94d8cd254 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394901 Commit-Queue: Daco Harkes <[email protected]> Auto-Submit: Bob Nystrom <[email protected]> Reviewed-by: Daco Harkes <[email protected]>
1 parent 54b3ca9 commit e4c8b49

File tree

106 files changed

+3873
-2405
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+3873
-2405
lines changed

benchmarks/AsyncLiveVars/dart/AsyncLiveVars.dart

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ import 'package:benchmark_harness/benchmark_harness.dart';
1111

1212
class MockClass {
1313
static final String str = "${int.parse('42')}";
14-
static final List<int> list =
15-
List<int>.filled(int.parse('3'), int.parse('42'));
14+
static final List<int> list = List<int>.filled(
15+
int.parse('3'),
16+
int.parse('42'),
17+
);
1618

1719
@pragma('vm:never-inline')
1820
@pragma('wasm:never-inline')
@@ -43,8 +45,16 @@ class MockClass {
4345
@pragma('vm:never-inline')
4446
@pragma('wasm:never-inline')
4547
@pragma('dart2js:noInline')
46-
void use8(String a0, List<int> a1, String a2, List<int> a3, String a4,
47-
List<int> a5, String a6, List<int> a7) =>
48+
void use8(
49+
String a0,
50+
List<int> a1,
51+
String a2,
52+
List<int> a3,
53+
String a4,
54+
List<int> a5,
55+
String a6,
56+
List<int> a7,
57+
) =>
4858
a0.length +
4959
a1.length +
5060
a2.length +
@@ -310,7 +320,7 @@ Future<void> main() async {
310320
LiveInt1(),
311321
LiveInt4(),
312322
LiveObj2Int2(),
313-
LiveObj4Int4()
323+
LiveObj4Int4(),
314324
];
315325
for (final bench in benchmarks) {
316326
await bench.report();

benchmarks/AsyncLiveVars/dart2/AsyncLiveVars.dart

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import 'package:benchmark_harness/benchmark_harness.dart';
1313

1414
class MockClass {
1515
static final String str = "${int.parse('42')}";
16-
static final List<int> list =
17-
List<int>.filled(int.parse('3'), int.parse('42'));
16+
static final List<int> list = List<int>.filled(
17+
int.parse('3'),
18+
int.parse('42'),
19+
);
1820

1921
@pragma('vm:never-inline')
2022
@pragma('dart2js:noInline')
@@ -39,8 +41,16 @@ class MockClass {
3941

4042
@pragma('vm:never-inline')
4143
@pragma('dart2js:noInline')
42-
void use8(String a0, List<int> a1, String a2, List<int> a3, String a4,
43-
List<int> a5, String a6, List<int> a7) =>
44+
void use8(
45+
String a0,
46+
List<int> a1,
47+
String a2,
48+
List<int> a3,
49+
String a4,
50+
List<int> a5,
51+
String a6,
52+
List<int> a7,
53+
) =>
4454
a0.length +
4555
a1.length +
4656
a2.length +
@@ -299,7 +309,7 @@ Future<void> main() async {
299309
LiveInt1(),
300310
LiveInt4(),
301311
LiveObj2Int2(),
302-
LiveObj4Int4()
312+
LiveObj4Int4(),
303313
];
304314
for (final bench in benchmarks) {
305315
await bench.report();

benchmarks/BigIntParsePrint/dart/BigIntParsePrint.dart

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ const requiredDigits = 11106;
3131
class Benchmark extends BenchmarkBase {
3232
final List<String> strings;
3333
Benchmark(String name, int bits, {bool forInt = false})
34-
: strings = generateStrings(bits, forInt),
35-
super(name);
34+
: strings = generateStrings(bits, forInt),
35+
super(name);
3636

3737
static List<String> generateStrings(int bits, bool forInt) {
3838
final List<String> strings = [];
@@ -270,7 +270,9 @@ class DummyBenchmark extends BenchmarkBase {
270270
/// is not available. This is to satisfy Golem's constraint that group
271271
/// benchmarks always produce results for the same set of series.
272272
BenchmarkBase Function() selectParseNativeBigIntBenchmark(
273-
String name, int bits) {
273+
String name,
274+
int bits,
275+
) {
274276
return nativeBigInt.enabled
275277
? () => ParseJsBigIntBenchmark(name, bits)
276278
: () => DummyBenchmark(name);
@@ -280,7 +282,9 @@ BenchmarkBase Function() selectParseNativeBigIntBenchmark(
280282
/// is not available. This is to satisfy Golem's constraint that group
281283
/// benchmarks always produce results for the same set of series.
282284
BenchmarkBase Function() selectFormatNativeBigIntBenchmark(
283-
String name, int bits) {
285+
String name,
286+
int bits,
287+
) {
284288
return nativeBigInt.enabled
285289
? () => FormatJsBigIntBenchmark(name, bits)
286290
: () => DummyBenchmark(name);
@@ -330,10 +334,13 @@ void main() {
330334
];
331335

332336
// Warm up all benchmarks to ensure consistent behavior of shared code.
333-
benchmarks.forEach((bm) => bm()
334-
..setup()
335-
..run()
336-
..run());
337+
benchmarks.forEach(
338+
(bm) =>
339+
bm()
340+
..setup()
341+
..run()
342+
..run(),
343+
);
337344

338345
benchmarks.forEach((bm) => bm().report());
339346
}

benchmarks/BigIntParsePrint/dart/native_version_javascript.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ void _setup() {
115115
_eval('self.bigint_subtract = function subtract(a, b) { return a - b; }');
116116
_eval('self.bigint_fromInt = function fromInt(i) { return BigInt(i); }');
117117

118-
_eval('self.bigint_bitLength = function bitLength(b) {'
119-
'return b == 0 ? 0 : (b < 0 ? ~b : b).toString(2).length;'
120-
'}');
118+
_eval(
119+
'self.bigint_bitLength = function bitLength(b) {'
120+
'return b == 0 ? 0 : (b < 0 ? ~b : b).toString(2).length;'
121+
'}',
122+
);
121123
_eval('self.bigint_isEven = function isEven(b) { return (b & 1n) == 0n; }');
122124
}
123125

benchmarks/BigIntParsePrint/dart2/BigIntParsePrint.dart

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ const requiredDigits = 11106;
3838
class Benchmark extends BenchmarkBase {
3939
final List<String> strings;
4040
Benchmark(String name, int bits, {bool forInt = false})
41-
: strings = generateStrings(bits, forInt),
42-
super(name);
41+
: strings = generateStrings(bits, forInt),
42+
super(name);
4343

4444
static List<String> generateStrings(int bits, bool forInt) {
4545
final List<String> strings = [];
@@ -253,7 +253,9 @@ class DummyBenchmark extends BenchmarkBase {
253253
/// is not available. This is to satisfy Golem's constraint that group
254254
/// benchmarks always produce results for the same set of series.
255255
BenchmarkBase Function() selectParseNativeBigIntBenchmark(
256-
String name, int bits) {
256+
String name,
257+
int bits,
258+
) {
257259
return nativeBigInt.enabled
258260
? () => ParseJsBigIntBenchmark(name, bits)
259261
: () => DummyBenchmark(name);
@@ -263,7 +265,9 @@ BenchmarkBase Function() selectParseNativeBigIntBenchmark(
263265
/// is not available. This is to satisfy Golem's constraint that group
264266
/// benchmarks always produce results for the same set of series.
265267
BenchmarkBase Function() selectFormatNativeBigIntBenchmark(
266-
String name, int bits) {
268+
String name,
269+
int bits,
270+
) {
267271
return nativeBigInt.enabled
268272
? () => FormatJsBigIntBenchmark(name, bits)
269273
: () => DummyBenchmark(name);
@@ -313,10 +317,13 @@ void main() {
313317
];
314318

315319
// Warm up all benchmarks to ensure consistent behaviors of shared code.
316-
benchmarks.forEach((bm) => bm()
317-
..setup()
318-
..run()
319-
..run());
320+
benchmarks.forEach(
321+
(bm) =>
322+
bm()
323+
..setup()
324+
..run()
325+
..run(),
326+
);
320327

321328
benchmarks.forEach((bm) => bm().report());
322329
}

benchmarks/BigIntParsePrint/dart2/native_version_javascript.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,11 @@ void _setup() {
117117
_eval('self.bigint_subtract = function subtract(a, b) { return a - b; }');
118118
_eval('self.bigint_fromInt = function fromInt(i) { return BigInt(i); }');
119119

120-
_eval('self.bigint_bitLength = function bitLength(b) {'
121-
'return b == 0 ? 0 : (b < 0 ? ~b : b).toString(2).length;'
122-
'}');
120+
_eval(
121+
'self.bigint_bitLength = function bitLength(b) {'
122+
'return b == 0 ? 0 : (b < 0 ? ~b : b).toString(2).length;'
123+
'}',
124+
);
123125
_eval('self.bigint_isEven = function isEven(b) { return (b & 1n) == 0n; }');
124126
}
125127

0 commit comments

Comments
 (0)