OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library protoc.benchmark.string_json; | 5 library protoc.benchmark.string_json; |
6 | 6 |
7 import '../benchmark.dart'; | 7 import '../benchmark.dart'; |
8 import '../generated/benchmark.pb.dart' | 8 import '../generated/benchmark.pb.dart' |
9 show BenchmarkID, Request, Params, Sample; | 9 show BenchmarkID, Request, Params, Sample; |
10 import '../generated/string_grid.pb.dart' as pb; | 10 import '../generated/string_grid.pb.dart' as pb; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 @override | 80 @override |
81 measureSample(Sample s) => stringReadsPerMillisecond(s); | 81 measureSample(Sample s) => stringReadsPerMillisecond(s); |
82 | 82 |
83 @override | 83 @override |
84 get measureSampleUnits => "string reads/ms"; | 84 get measureSampleUnits => "string reads/ms"; |
85 | 85 |
86 static const $id = BenchmarkID.READ_STRING_FIELDS_JSON; | 86 static const $id = BenchmarkID.READ_STRING_FIELDS_JSON; |
87 static final $type = new BenchmarkType($id, $create); | 87 static final $type = new BenchmarkType($id, $create); |
88 | 88 |
89 static $create(Request r) { | 89 static StringBenchmark $create(Request r) { |
90 assert(r.params.hasStringFieldCount()); | 90 assert(r.params.hasStringFieldCount()); |
91 assert(r.params.hasMessageCount()); | 91 assert(r.params.hasMessageCount()); |
92 assert(r.params.hasStringSize()); | 92 assert(r.params.hasStringSize()); |
93 return new StringBenchmark( | 93 return new StringBenchmark( |
94 r.params.stringFieldCount, r.params.messageCount, r.params.stringSize); | 94 r.params.stringFieldCount, r.params.messageCount, r.params.stringSize); |
95 } | 95 } |
96 } | 96 } |
OLD | NEW |