diff options
| author | Tyge Løvset <[email protected]> | 2021-12-19 12:21:44 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-12-19 12:21:44 +0100 |
| commit | 92b950333c6c7002bdbf1b60af44a249dc0cef9c (patch) | |
| tree | 4b1acfcdba0bd940f829c53910587e27b5e0af90 /benchmarks/plotbench | |
| parent | 183a89859ba9914ee0546e4482b40be199e52292 (diff) | |
| download | STC-modified-92b950333c6c7002bdbf1b60af44a249dc0cef9c.tar.gz STC-modified-92b950333c6c7002bdbf1b60af44a249dc0cef9c.zip | |
First commit for Version 3 of STC. Main changes are consistent rename of '_del' to '_drop' and '_compare' to '_cmp'.
Also i_key_ref (earlier i_key_sptr) and i_val_ref replaced by more general i_key_bind/i_val_bind.
Diffstat (limited to 'benchmarks/plotbench')
| -rw-r--r-- | benchmarks/plotbench/cdeq_benchmark.cpp | 4 | ||||
| -rw-r--r-- | benchmarks/plotbench/clist_benchmark.cpp | 4 | ||||
| -rw-r--r-- | benchmarks/plotbench/cmap_benchmark.cpp | 4 | ||||
| -rw-r--r-- | benchmarks/plotbench/cpque_benchmark.cpp | 9 | ||||
| -rw-r--r-- | benchmarks/plotbench/csmap_benchmark.cpp | 4 | ||||
| -rw-r--r-- | benchmarks/plotbench/cvec_benchmark.cpp | 4 |
6 files changed, 15 insertions, 14 deletions
diff --git a/benchmarks/plotbench/cdeq_benchmark.cpp b/benchmarks/plotbench/cdeq_benchmark.cpp index 6db167b0..f57da6b2 100644 --- a/benchmarks/plotbench/cdeq_benchmark.cpp +++ b/benchmarks/plotbench/cdeq_benchmark.cpp @@ -81,7 +81,7 @@ Sample test_stc_deque() { c_forrange (cdeq_x_size(con)/2) { cdeq_x_pop_front(&con); cdeq_x_pop_back(&con); }
s.test[ERASE].t2 = clock();
s.test[ERASE].sum = cdeq_x_size(con);
- cdeq_x_del(&con);
+ cdeq_x_drop(&con);
}{
stc64_srandom(seed);
container con = cdeq_x_init();
@@ -98,7 +98,7 @@ Sample test_stc_deque() { s.test[ITER].t2 = clock();
s.test[ITER].sum = sum;
s.test[DESTRUCT].t1 = clock();
- cdeq_x_del(&con);
+ cdeq_x_drop(&con);
}
s.test[DESTRUCT].t2 = clock();
s.test[DESTRUCT].sum = 0;
diff --git a/benchmarks/plotbench/clist_benchmark.cpp b/benchmarks/plotbench/clist_benchmark.cpp index 676d31e7..eaa18201 100644 --- a/benchmarks/plotbench/clist_benchmark.cpp +++ b/benchmarks/plotbench/clist_benchmark.cpp @@ -78,7 +78,7 @@ Sample test_stc_forward_list() { c_forrange (N) clist_x_pop_front(&con);
s.test[ERASE].t2 = clock();
s.test[ERASE].sum = 0;
- clist_x_del(&con);
+ clist_x_drop(&con);
}{
stc64_srandom(seed);
container con = clist_x_init();
@@ -95,7 +95,7 @@ Sample test_stc_forward_list() { s.test[ITER].t2 = clock();
s.test[ITER].sum = sum;
s.test[DESTRUCT].t1 = clock();
- clist_x_del(&con);
+ clist_x_drop(&con);
}
s.test[DESTRUCT].t2 = clock();
s.test[DESTRUCT].sum = 0;
diff --git a/benchmarks/plotbench/cmap_benchmark.cpp b/benchmarks/plotbench/cmap_benchmark.cpp index 4c9c6c16..16aec8c0 100644 --- a/benchmarks/plotbench/cmap_benchmark.cpp +++ b/benchmarks/plotbench/cmap_benchmark.cpp @@ -82,7 +82,7 @@ Sample test_stc_unordered_map() { c_forrange (N) cmap_x_erase(&con, stc64_random() & mask1);
s.test[ERASE].t2 = clock();
s.test[ERASE].sum = cmap_x_size(con);
- cmap_x_del(&con);
+ cmap_x_drop(&con);
}{
container con = cmap_x_init();
stc64_srandom(seed);
@@ -103,7 +103,7 @@ Sample test_stc_unordered_map() { s.test[ITER].t2 = clock();
s.test[ITER].sum = sum;
s.test[DESTRUCT].t1 = clock();
- cmap_x_del(&con);
+ cmap_x_drop(&con);
}
s.test[DESTRUCT].t2 = clock();
s.test[DESTRUCT].sum = 0;
diff --git a/benchmarks/plotbench/cpque_benchmark.cpp b/benchmarks/plotbench/cpque_benchmark.cpp index 19a9c701..33e55719 100644 --- a/benchmarks/plotbench/cpque_benchmark.cpp +++ b/benchmarks/plotbench/cpque_benchmark.cpp @@ -3,7 +3,7 @@ #include <stc/crandom.h>
#define i_val float
-#define i_cmp -c_default_compare
+#define i_cmp -c_default_cmp
#define i_tag f
#include <stc/cpque.h>
@@ -14,11 +14,12 @@ int main() int N = 10000000, M = 10;
cpque_f pq = cpque_f_init();
+ cpque_f_resize(&pq, N, 0.0f);
rng = stc64_init(seed);
clock_t start = clock();
- c_forrange (i, int, N)
- cpque_f_push_back(&pq, (float) stc64_randf(&rng)*100000);
+ c_forrange (i, N)
+ pq.data[i] = (float) stc64_randf(&rng)*100000;
cpque_f_make_heap(&pq);
printf("Built priority queue: %f secs\n", (clock() - start) / (float) CLOCKS_PER_SEC);
@@ -44,5 +45,5 @@ int main() }
puts("");
- cpque_f_del(&pq);
+ cpque_f_drop(&pq);
}
diff --git a/benchmarks/plotbench/csmap_benchmark.cpp b/benchmarks/plotbench/csmap_benchmark.cpp index 47762791..4d1621e3 100644 --- a/benchmarks/plotbench/csmap_benchmark.cpp +++ b/benchmarks/plotbench/csmap_benchmark.cpp @@ -82,7 +82,7 @@ Sample test_stc_map() { c_forrange (N) csmap_x_erase(&con, stc64_random() & mask1);
s.test[ERASE].t2 = clock();
s.test[ERASE].sum = csmap_x_size(con);
- csmap_x_del(&con);
+ csmap_x_drop(&con);
}{
container con = csmap_x_init();
stc64_srandom(seed);
@@ -103,7 +103,7 @@ Sample test_stc_map() { s.test[ITER].t2 = clock();
s.test[ITER].sum = sum;
s.test[DESTRUCT].t1 = clock();
- csmap_x_del(&con);
+ csmap_x_drop(&con);
}
s.test[DESTRUCT].t2 = clock();
s.test[DESTRUCT].sum = 0;
diff --git a/benchmarks/plotbench/cvec_benchmark.cpp b/benchmarks/plotbench/cvec_benchmark.cpp index c4648e34..21e7a229 100644 --- a/benchmarks/plotbench/cvec_benchmark.cpp +++ b/benchmarks/plotbench/cvec_benchmark.cpp @@ -77,7 +77,7 @@ Sample test_stc_vector() { c_forrange (N) { cvec_x_pop_back(&con); }
s.test[ERASE].t2 = clock();
s.test[ERASE].sum = cvec_x_size(con);
- cvec_x_del(&con);
+ cvec_x_drop(&con);
}{
stc64_srandom(seed);
container con = cvec_x_init();
@@ -94,7 +94,7 @@ Sample test_stc_vector() { s.test[ITER].t2 = clock();
s.test[ITER].sum = sum;
s.test[DESTRUCT].t1 = clock();
- cvec_x_del(&con);
+ cvec_x_drop(&con);
}
s.test[DESTRUCT].t2 = clock();
s.test[DESTRUCT].sum = 0;
|
