@@ -13,40 +13,39 @@ import 'package:ffi/ffi.dart';
13
13
14
14
const maxSizeInBytes = 10 * 1024 * 1024 ;
15
15
16
- final argParser =
17
- ArgParser ()
18
- ..addMultiOption (
19
- 'length' ,
20
- abbr: 'l' ,
21
- help: 'Byte length to benchmark' ,
22
- valueHelp: 'INT' ,
23
- defaultsTo: const [],
24
- )
25
- ..addFlag (
26
- 'mebibytes-per-second' ,
27
- abbr: 'm' ,
28
- help: 'Show MiB/s' ,
29
- defaultsTo: false ,
30
- )
31
- ..addFlag (
32
- 'nanoseconds-per-byte' ,
33
- abbr: 'n' ,
34
- help: 'Show ns/byte' ,
35
- defaultsTo: false ,
36
- )
37
- ..addFlag (
38
- 'bytes-per-second' ,
39
- abbr: 'b' ,
40
- help: 'Show byte/s' ,
41
- defaultsTo: true ,
42
- )
43
- ..addFlag ('verbose' , abbr: 'v' , help: 'Verbose output' , defaultsTo: false )
44
- ..addFlag (
45
- 'aligned' ,
46
- abbr: 'a' ,
47
- help: 'Align results on initial numbers' ,
48
- defaultsTo: false ,
49
- );
16
+ final argParser = ArgParser ()
17
+ ..addMultiOption (
18
+ 'length' ,
19
+ abbr: 'l' ,
20
+ help: 'Byte length to benchmark' ,
21
+ valueHelp: 'INT' ,
22
+ defaultsTo: const [],
23
+ )
24
+ ..addFlag (
25
+ 'mebibytes-per-second' ,
26
+ abbr: 'm' ,
27
+ help: 'Show MiB/s' ,
28
+ defaultsTo: false ,
29
+ )
30
+ ..addFlag (
31
+ 'nanoseconds-per-byte' ,
32
+ abbr: 'n' ,
33
+ help: 'Show ns/byte' ,
34
+ defaultsTo: false ,
35
+ )
36
+ ..addFlag (
37
+ 'bytes-per-second' ,
38
+ abbr: 'b' ,
39
+ help: 'Show byte/s' ,
40
+ defaultsTo: true ,
41
+ )
42
+ ..addFlag ('verbose' , abbr: 'v' , help: 'Verbose output' , defaultsTo: false )
43
+ ..addFlag (
44
+ 'aligned' ,
45
+ abbr: 'a' ,
46
+ help: 'Align results on initial numbers' ,
47
+ defaultsTo: false ,
48
+ );
50
49
51
50
class Emitter {
52
51
final bool bytesPerSecond;
@@ -118,10 +117,9 @@ abstract class MemoryCopyBenchmark {
118
117
// to avoid discarding results that almost, but not quite, reach the minimum
119
118
// duration requested.
120
119
final allowedJitter = Duration (
121
- microseconds:
122
- minDuration.inSeconds > 0
123
- ? (minDuration.inMicroseconds * 0.1 ).floor ()
124
- : 0 ,
120
+ microseconds: minDuration.inSeconds > 0
121
+ ? (minDuration.inMicroseconds * 0.1 ).floor ()
122
+ : 0 ,
125
123
);
126
124
127
125
final watch = Stopwatch ()..start ();
@@ -475,11 +473,10 @@ void main(List<String> args) {
475
473
List <int > lengthsInBytes = defaultLengthsInBytes;
476
474
final emitter = Emitter (results);
477
475
if (results['length' ].isNotEmpty) {
478
- lengthsInBytes =
479
- (results['length' ] as List <String >)
480
- .map (int .parse)
481
- .where ((i) => i <= maxSizeInBytes)
482
- .toList ();
476
+ lengthsInBytes = (results['length' ] as List <String >)
477
+ .map (int .parse)
478
+ .where ((i) => i <= maxSizeInBytes)
479
+ .toList ();
483
480
}
484
481
final filter = results.rest.firstOrNull;
485
482
final benchmarks = [
0 commit comments