Prepare query_benchmark/ for NNBD (#451)
diff --git a/query_benchmark/bin/decode.dart b/query_benchmark/bin/decode.dart
index 83de4b6..bf6e0ff 100644
--- a/query_benchmark/bin/decode.dart
+++ b/query_benchmark/bin/decode.dart
@@ -7,7 +7,8 @@
import 'package:query_benchmark/readfile.dart';
main() {
- String path = const String.fromEnvironment('testfile') ?? 'testdata/500.pb';
+ final path =
+ const String.fromEnvironment('testfile', defaultValue: 'testdata/500.pb');
List<int> encoded = readfile(path);
print(
diff --git a/query_benchmark/bin/decode_json.dart b/query_benchmark/bin/decode_json.dart
index 64d365d..8901b91 100644
--- a/query_benchmark/bin/decode_json.dart
+++ b/query_benchmark/bin/decode_json.dart
@@ -7,7 +7,8 @@
import 'package:query_benchmark/readfile.dart';
main() {
- String path = const String.fromEnvironment('testfile') ?? 'testdata/500.pb';
+ final path =
+ const String.fromEnvironment('testfile', defaultValue: 'testdata/500.pb');
List<int> encoded = readfile(path);
f0.A0 a = f0.A0.fromBuffer(encoded);
diff --git a/query_benchmark/bin/encode.dart b/query_benchmark/bin/encode.dart
index 2fb2d53..93a2619 100644
--- a/query_benchmark/bin/encode.dart
+++ b/query_benchmark/bin/encode.dart
@@ -7,7 +7,9 @@
import 'package:query_benchmark/readfile.dart';
main() {
- String path = const String.fromEnvironment('testfile') ?? 'testdata/500.pb';
+ final path =
+ const String.fromEnvironment('testfile', defaultValue: 'testdata/500.pb');
+
List<int> encoded = readfile(path);
f0.A0 a = f0.A0.fromBuffer(encoded);
print(
diff --git a/query_benchmark/bin/encode_json.dart b/query_benchmark/bin/encode_json.dart
index faa95ff..00d5a99 100644
--- a/query_benchmark/bin/encode_json.dart
+++ b/query_benchmark/bin/encode_json.dart
@@ -7,7 +7,8 @@
import 'package:query_benchmark/readfile.dart';
main() {
- String path = const String.fromEnvironment('testfile') ?? 'testdata/500.pb';
+ final path =
+ const String.fromEnvironment('testfile', defaultValue: 'testdata/500.pb');
List<int> encoded = readfile(path);
f0.A0 a = f0.A0.fromBuffer(encoded);
diff --git a/query_benchmark/bin/set_nested_value.dart b/query_benchmark/bin/set_nested_value.dart
index 94698a0..05b26d0 100644
--- a/query_benchmark/bin/set_nested_value.dart
+++ b/query_benchmark/bin/set_nested_value.dart
@@ -9,7 +9,8 @@
import 'package:query_benchmark/readfile.dart';
main() {
- String path = const String.fromEnvironment('testfile') ?? 'testdata/500.pb';
+ final path =
+ const String.fromEnvironment('testfile', defaultValue: 'testdata/500.pb');
List<int> encoded = readfile(path);
f0.A0 a = f0.A0.fromBuffer(encoded)..freeze();
diff --git a/query_benchmark/lib/benchmark.dart b/query_benchmark/lib/benchmark.dart
index 1c35553..2bae31c 100644
--- a/query_benchmark/lib/benchmark.dart
+++ b/query_benchmark/lib/benchmark.dart
@@ -17,6 +17,6 @@
return s.elapsed ~/ iterations;
}
-String formatReport({String title, Duration duration}) {
+String formatReport({required String title, required Duration duration}) {
return "RunTimeRaw($title): ${duration.inMicroseconds} us";
}
diff --git a/query_benchmark/pubspec.yaml b/query_benchmark/pubspec.yaml
index 54a9833..f264e55 100644
--- a/query_benchmark/pubspec.yaml
+++ b/query_benchmark/pubspec.yaml
@@ -6,7 +6,7 @@
description: Measuring encoding and decoding of a "real-world" protobuf.
environment:
- sdk: '>=2.3.0 <3.0.0'
+ sdk: '>=2.12.0-0 <3.0.0'
dependencies:
protobuf: