Skip to content

Commit

Permalink
Version 3.7.0-158.0.dev
Browse files Browse the repository at this point in the history
Merge e4c8b49 into dev
  • Loading branch information
Dart CI committed Nov 18, 2024
2 parents 8795a3e + e4c8b49 commit ae51110
Show file tree
Hide file tree
Showing 210 changed files with 4,848 additions and 2,525 deletions.
20 changes: 15 additions & 5 deletions benchmarks/AsyncLiveVars/dart/AsyncLiveVars.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import 'package:benchmark_harness/benchmark_harness.dart';

class MockClass {
static final String str = "${int.parse('42')}";
static final List<int> list =
List<int>.filled(int.parse('3'), int.parse('42'));
static final List<int> list = List<int>.filled(
int.parse('3'),
int.parse('42'),
);

@pragma('vm:never-inline')
@pragma('wasm:never-inline')
Expand Down Expand Up @@ -43,8 +45,16 @@ class MockClass {
@pragma('vm:never-inline')
@pragma('wasm:never-inline')
@pragma('dart2js:noInline')
void use8(String a0, List<int> a1, String a2, List<int> a3, String a4,
List<int> a5, String a6, List<int> a7) =>
void use8(
String a0,
List<int> a1,
String a2,
List<int> a3,
String a4,
List<int> a5,
String a6,
List<int> a7,
) =>
a0.length +
a1.length +
a2.length +
Expand Down Expand Up @@ -310,7 +320,7 @@ Future<void> main() async {
LiveInt1(),
LiveInt4(),
LiveObj2Int2(),
LiveObj4Int4()
LiveObj4Int4(),
];
for (final bench in benchmarks) {
await bench.report();
Expand Down
20 changes: 15 additions & 5 deletions benchmarks/AsyncLiveVars/dart2/AsyncLiveVars.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import 'package:benchmark_harness/benchmark_harness.dart';

class MockClass {
static final String str = "${int.parse('42')}";
static final List<int> list =
List<int>.filled(int.parse('3'), int.parse('42'));
static final List<int> list = List<int>.filled(
int.parse('3'),
int.parse('42'),
);

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

@pragma('vm:never-inline')
@pragma('dart2js:noInline')
void use8(String a0, List<int> a1, String a2, List<int> a3, String a4,
List<int> a5, String a6, List<int> a7) =>
void use8(
String a0,
List<int> a1,
String a2,
List<int> a3,
String a4,
List<int> a5,
String a6,
List<int> a7,
) =>
a0.length +
a1.length +
a2.length +
Expand Down Expand Up @@ -299,7 +309,7 @@ Future<void> main() async {
LiveInt1(),
LiveInt4(),
LiveObj2Int2(),
LiveObj4Int4()
LiveObj4Int4(),
];
for (final bench in benchmarks) {
await bench.report();
Expand Down
23 changes: 15 additions & 8 deletions benchmarks/BigIntParsePrint/dart/BigIntParsePrint.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const requiredDigits = 11106;
class Benchmark extends BenchmarkBase {
final List<String> strings;
Benchmark(String name, int bits, {bool forInt = false})
: strings = generateStrings(bits, forInt),
super(name);
: strings = generateStrings(bits, forInt),
super(name);

static List<String> generateStrings(int bits, bool forInt) {
final List<String> strings = [];
Expand Down Expand Up @@ -270,7 +270,9 @@ class DummyBenchmark extends BenchmarkBase {
/// is not available. This is to satisfy Golem's constraint that group
/// benchmarks always produce results for the same set of series.
BenchmarkBase Function() selectParseNativeBigIntBenchmark(
String name, int bits) {
String name,
int bits,
) {
return nativeBigInt.enabled
? () => ParseJsBigIntBenchmark(name, bits)
: () => DummyBenchmark(name);
Expand All @@ -280,7 +282,9 @@ BenchmarkBase Function() selectParseNativeBigIntBenchmark(
/// is not available. This is to satisfy Golem's constraint that group
/// benchmarks always produce results for the same set of series.
BenchmarkBase Function() selectFormatNativeBigIntBenchmark(
String name, int bits) {
String name,
int bits,
) {
return nativeBigInt.enabled
? () => FormatJsBigIntBenchmark(name, bits)
: () => DummyBenchmark(name);
Expand Down Expand Up @@ -330,10 +334,13 @@ void main() {
];

// Warm up all benchmarks to ensure consistent behavior of shared code.
benchmarks.forEach((bm) => bm()
..setup()
..run()
..run());
benchmarks.forEach(
(bm) =>
bm()
..setup()
..run()
..run(),
);

benchmarks.forEach((bm) => bm().report());
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ void _setup() {
_eval('self.bigint_subtract = function subtract(a, b) { return a - b; }');
_eval('self.bigint_fromInt = function fromInt(i) { return BigInt(i); }');

_eval('self.bigint_bitLength = function bitLength(b) {'
'return b == 0 ? 0 : (b < 0 ? ~b : b).toString(2).length;'
'}');
_eval(
'self.bigint_bitLength = function bitLength(b) {'
'return b == 0 ? 0 : (b < 0 ? ~b : b).toString(2).length;'
'}',
);
_eval('self.bigint_isEven = function isEven(b) { return (b & 1n) == 0n; }');
}

Expand Down
23 changes: 15 additions & 8 deletions benchmarks/BigIntParsePrint/dart2/BigIntParsePrint.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ const requiredDigits = 11106;
class Benchmark extends BenchmarkBase {
final List<String> strings;
Benchmark(String name, int bits, {bool forInt = false})
: strings = generateStrings(bits, forInt),
super(name);
: strings = generateStrings(bits, forInt),
super(name);

static List<String> generateStrings(int bits, bool forInt) {
final List<String> strings = [];
Expand Down Expand Up @@ -253,7 +253,9 @@ class DummyBenchmark extends BenchmarkBase {
/// is not available. This is to satisfy Golem's constraint that group
/// benchmarks always produce results for the same set of series.
BenchmarkBase Function() selectParseNativeBigIntBenchmark(
String name, int bits) {
String name,
int bits,
) {
return nativeBigInt.enabled
? () => ParseJsBigIntBenchmark(name, bits)
: () => DummyBenchmark(name);
Expand All @@ -263,7 +265,9 @@ BenchmarkBase Function() selectParseNativeBigIntBenchmark(
/// is not available. This is to satisfy Golem's constraint that group
/// benchmarks always produce results for the same set of series.
BenchmarkBase Function() selectFormatNativeBigIntBenchmark(
String name, int bits) {
String name,
int bits,
) {
return nativeBigInt.enabled
? () => FormatJsBigIntBenchmark(name, bits)
: () => DummyBenchmark(name);
Expand Down Expand Up @@ -313,10 +317,13 @@ void main() {
];

// Warm up all benchmarks to ensure consistent behaviors of shared code.
benchmarks.forEach((bm) => bm()
..setup()
..run()
..run());
benchmarks.forEach(
(bm) =>
bm()
..setup()
..run()
..run(),
);

benchmarks.forEach((bm) => bm().report());
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ void _setup() {
_eval('self.bigint_subtract = function subtract(a, b) { return a - b; }');
_eval('self.bigint_fromInt = function fromInt(i) { return BigInt(i); }');

_eval('self.bigint_bitLength = function bitLength(b) {'
'return b == 0 ? 0 : (b < 0 ? ~b : b).toString(2).length;'
'}');
_eval(
'self.bigint_bitLength = function bitLength(b) {'
'return b == 0 ? 0 : (b < 0 ? ~b : b).toString(2).length;'
'}',
);
_eval('self.bigint_isEven = function isEven(b) { return (b & 1n) == 0n; }');
}

Expand Down
Loading

0 comments on commit ae51110

Please sign in to comment.