OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkRandom.h" | 9 #include "SkRandom.h" |
10 #include "SkString.h" | 10 #include "SkString.h" |
11 #include "SkTSort.h" | 11 #include "SkTSort.h" |
12 | 12 |
| 13 #include <stdlib.h> |
| 14 |
13 static const int N = 1000; | 15 static const int N = 1000; |
14 | 16 |
15 static void rand_proc(int array[N]) { | 17 static void rand_proc(int array[N]) { |
16 SkRandom rand; | 18 SkRandom rand; |
17 for (int i = 0; i < N; ++i) { | 19 for (int i = 0; i < N; ++i) { |
18 array[i] = rand.nextS(); | 20 array[i] = rand.nextS(); |
19 } | 21 } |
20 } | 22 } |
21 | 23 |
22 static void randN_proc(int array[N]) { | 24 static void randN_proc(int array[N]) { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 DEF_BENCH( return NewSkHeap(kFore); ) | 165 DEF_BENCH( return NewSkHeap(kFore); ) |
164 DEF_BENCH( return NewQSort(kFore); ) | 166 DEF_BENCH( return NewQSort(kFore); ) |
165 | 167 |
166 DEF_BENCH( return NewSkQSort(kBack); ) | 168 DEF_BENCH( return NewSkQSort(kBack); ) |
167 DEF_BENCH( return NewSkHeap(kBack); ) | 169 DEF_BENCH( return NewSkHeap(kBack); ) |
168 DEF_BENCH( return NewQSort(kBack); ) | 170 DEF_BENCH( return NewQSort(kBack); ) |
169 | 171 |
170 DEF_BENCH( return NewSkQSort(kSame); ) | 172 DEF_BENCH( return NewSkQSort(kSame); ) |
171 DEF_BENCH( return NewSkHeap(kSame); ) | 173 DEF_BENCH( return NewSkHeap(kSame); ) |
172 DEF_BENCH( return NewQSort(kSame); ) | 174 DEF_BENCH( return NewQSort(kSame); ) |
OLD | NEW |