diff options
| author | Tyge Løvset <[email protected]> | 2021-11-03 11:30:06 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-11-03 11:30:06 +0100 |
| commit | e259ed7807dd9474cc94ba625db4dcd573431362 (patch) | |
| tree | 0e83bf2d49a1f0ec43f9e9b0b74c69ef4fd97a1b /benchmarks | |
| parent | 73b1ed7c17b94647438c7e73738bf0820e5d57ad (diff) | |
| download | STC-modified-e259ed7807dd9474cc94ba625db4dcd573431362.tar.gz STC-modified-e259ed7807dd9474cc94ba625db4dcd573431362.zip | |
Changed container_X_get() and container_X_at() to return const value* (or const mapped*). Added container_X_getmut() for mutable version. Updated docs.
Diffstat (limited to 'benchmarks')
| -rw-r--r-- | benchmarks/cmap_benchmark.cpp | 2 | ||||
| -rw-r--r-- | benchmarks/csmap_benchmark.cpp | 2 | ||||
| -rw-r--r-- | benchmarks/rust_cmap.c | 1 | ||||
| -rw-r--r-- | benchmarks/shootout3_csmap.cpp | 2 |
4 files changed, 3 insertions, 4 deletions
diff --git a/benchmarks/cmap_benchmark.cpp b/benchmarks/cmap_benchmark.cpp index dc104c2d..0dbe5a31 100644 --- a/benchmarks/cmap_benchmark.cpp +++ b/benchmarks/cmap_benchmark.cpp @@ -91,7 +91,7 @@ Sample test_stc_unordered_map() { stc64_srandom(seed);
s.test[FIND].t1 = clock();
size_t sum = 0;
- cmap_x_value* val;
+ const cmap_x_value* val;
c_forrange (N)
if ((val = cmap_x_get(&con, stc64_random() & mask1)))
sum += val->second;
diff --git a/benchmarks/csmap_benchmark.cpp b/benchmarks/csmap_benchmark.cpp index bb055367..47762791 100644 --- a/benchmarks/csmap_benchmark.cpp +++ b/benchmarks/csmap_benchmark.cpp @@ -91,7 +91,7 @@ Sample test_stc_map() { stc64_srandom(seed);
s.test[FIND].t1 = clock();
size_t sum = 0;
- csmap_x_value* val;
+ const csmap_x_value* val;
c_forrange (N)
if ((val = csmap_x_get(&con, stc64_random() & mask1)))
sum += val->second;
diff --git a/benchmarks/rust_cmap.c b/benchmarks/rust_cmap.c index 6014b23d..88dfbec1 100644 --- a/benchmarks/rust_cmap.c +++ b/benchmarks/rust_cmap.c @@ -27,7 +27,6 @@ int main() { c_forrange (n) {
uint64_t key = romu_trio(rng) & mask;
cmap_u64_insert(&m, key, 0).ref->second += 1;
-
}
printf("insert : %zums \tsize : %zu\n", (clock() - now)/ms, cmap_u64_size(m));
now = clock();
diff --git a/benchmarks/shootout3_csmap.cpp b/benchmarks/shootout3_csmap.cpp index dfa0ab1b..7a0addad 100644 --- a/benchmarks/shootout3_csmap.cpp +++ b/benchmarks/shootout3_csmap.cpp @@ -179,7 +179,7 @@ static void ins_and_access_csmap_i(picobench::state& s) picobench::scope scope(s);
c_forrange (s.iterations()) {
result += ++csmap_i_emplace(&map, stc64_random() & mask, 0).ref->second;
- csmap_i_value* val = csmap_i_get(&map, stc64_random() & mask);
+ const csmap_i_value* val = csmap_i_get(&map, stc64_random() & mask);
if (val) csmap_i_erase(&map, val->first);
}
s.set_result(result + csmap_i_size(map));
|
