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.set_strings; | 5 library protoc.benchmark.set_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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 @override | 92 @override |
93 measureSample(Sample s) => stringWritesPerMillisecond(s); | 93 measureSample(Sample s) => stringWritesPerMillisecond(s); |
94 | 94 |
95 @override | 95 @override |
96 get measureSampleUnits => "string writes/ms"; | 96 get measureSampleUnits => "string writes/ms"; |
97 | 97 |
98 static const $id = BenchmarkID.SET_STRINGS; | 98 static const $id = BenchmarkID.SET_STRINGS; |
99 static final $type = new BenchmarkType($id, $create); | 99 static final $type = new BenchmarkType($id, $create); |
100 | 100 |
101 static $create(Request r) { | 101 static SetStringsBenchmark $create(Request r) { |
102 assert(r.params.hasMessageCount()); | 102 assert(r.params.hasMessageCount()); |
103 var value = null; | 103 var value = null; |
104 if (r.params.hasStringValue()) value = r.params.stringValue; | 104 if (r.params.hasStringValue()) value = r.params.stringValue; |
105 return new SetStringsBenchmark(r.params.messageCount, value); | 105 return new SetStringsBenchmark(r.params.messageCount, value); |
106 } | 106 } |
107 } | 107 } |
OLD | NEW |