19static const int N = 1000;
23 for (
int i = 0;
i <
N; ++
i) {
31 for (
int i = 0;
i <
N; ++
i) {
32 array[
i] = rand.
nextU() % mod;
37 for (
int i = 0;
i <
N; ++
i) {
43 for (
int i = 0;
i <
N; ++
i) {
49 for (
int i = 0;
i <
N; ++
i) {
72 SkTQSort<int>(array, array +
N);
76 SkTHeapSort<int>(array,
N);
81 const int ai = *(
const int*)
a;
82 const int bi = *(
const int*)
b;
83 return ai < bi ? -1 : (ai > bi);
126 return fName.c_str();
132 gRec[fType].fProc(fUnsorted.
get());
137 for (
int i = 0;
i < loops;
i++) {
138 memcpy(sorted.
get(), fUnsorted.
get(),
N*
sizeof(
int));
139 fSortProc(sorted.
get());
141 for (
int j = 1; j <
N; ++j) {
142 SkASSERT(sorted[j - 1] <= sorted[j]);
static std::vector< SkPDFIndirectReference > sort(const THashSet< SkPDFIndirectReference > &src)
static void qsort_sort(int array[N])
static void skheap_sort(int array[N])
static void stdsort_sort(int array[N])
static int int_compare(const void *a, const void *b)
static void randN_proc(int array[N])
static const struct @256 gSorts[]
static void backward_proc(int array[N])
static Benchmark * NewSkQSort(Type t)
static void rand_proc(int array[N])
static const struct @255 gRec[]
static void same_proc(int array[N])
static void forward_proc(int array[N])
static Benchmark * NewQSort(Type t)
static Benchmark * NewStdSort(Type t)
static void skqsort_sort(int array[N])
static Benchmark * NewSkHeap(Type t)
void(* SortProc)(int array[N])
const char * onGetName() override
void onDraw(int loops, SkCanvas *) override
bool isSuitableFor(Backend backend) override
SortBench(Type t, SortType s)
void onDelayedSetup() override
T * reset(size_t count=0)