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.has_strings; | 5 library protoc.benchmark.has_strings; |
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 @override | 118 @override |
119 measureSample(Sample s) => stringReadsPerMillisecond(s); | 119 measureSample(Sample s) => stringReadsPerMillisecond(s); |
120 | 120 |
121 @override | 121 @override |
122 get measureSampleUnits => "string reads/ms"; | 122 get measureSampleUnits => "string reads/ms"; |
123 | 123 |
124 static const $id = BenchmarkID.HAS_STRINGS; | 124 static const $id = BenchmarkID.HAS_STRINGS; |
125 static final $type = new BenchmarkType($id, $create); | 125 static final $type = new BenchmarkType($id, $create); |
126 | 126 |
127 static $create(Request r) { | 127 static HasStringsBenchmark $create(Request r) { |
128 assert(r.params.hasMessageCount()); | 128 assert(r.params.hasMessageCount()); |
129 var value = null; | 129 var value = null; |
130 if (r.params.hasStringValue()) value = r.params.stringValue; | 130 if (r.params.hasStringValue()) value = r.params.stringValue; |
131 return new HasStringsBenchmark(r.params.messageCount, value); | 131 return new HasStringsBenchmark(r.params.messageCount, value); |
132 } | 132 } |
133 } | 133 } |
OLD | NEW |