OLD | NEW |
| (Empty) |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 library observe.test.benchmark.object_benchmark; | |
5 | |
6 import 'observation_benchmark_base.dart'; | |
7 import 'test_observable.dart'; | |
8 | |
9 class ObjectBenchmark extends ObservationBenchmarkBase { | |
10 ObjectBenchmark(int objectCount, int mutationCount, String config) : super( | |
11 'ObjectBenchmark:$objectCount:$mutationCount:$config', objectCount, | |
12 mutationCount, config); | |
13 | |
14 @override | |
15 int mutateObject(TestObservable obj) { | |
16 // Modify the first 5 properties. | |
17 obj.a++; | |
18 obj.b++; | |
19 obj.c++; | |
20 obj.d++; | |
21 obj.e++; | |
22 // Return # of modifications. | |
23 return 5; | |
24 } | |
25 | |
26 @override | |
27 TestObservable newObject() => new TestObservable(); | |
28 } | |
OLD | NEW |