diff options
| author | Tyge Lovset <[email protected]> | 2023-04-07 13:33:06 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-04-07 13:33:06 +0200 |
| commit | 13eb85e05a88633454df7b62b80737fcc9d12238 (patch) | |
| tree | 302886fb464409ba5633ffebfcf7186c4671e336 /misc/benchmarks/plotbench/cmap_benchmark.cpp | |
| parent | 2ad41420a973a3f1bd1ca47ab0f61b8f59ab9e66 (diff) | |
| download | STC-modified-13eb85e05a88633454df7b62b80737fcc9d12238.tar.gz STC-modified-13eb85e05a88633454df7b62b80737fcc9d12238.zip | |
Massive documentation update/improvements.
Reduced benchmarks/plotbench repetition/sizes.
Diffstat (limited to 'misc/benchmarks/plotbench/cmap_benchmark.cpp')
| -rw-r--r-- | misc/benchmarks/plotbench/cmap_benchmark.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/benchmarks/plotbench/cmap_benchmark.cpp b/misc/benchmarks/plotbench/cmap_benchmark.cpp index 0582d162..6b2edbd7 100644 --- a/misc/benchmarks/plotbench/cmap_benchmark.cpp +++ b/misc/benchmarks/plotbench/cmap_benchmark.cpp @@ -11,7 +11,7 @@ enum {INSERT, ERASE, FIND, ITER, DESTRUCT, N_TESTS}; const char* operations[] = {"insert", "erase", "find", "iter", "destruct"}; typedef struct { time_t t1, t2; uint64_t sum; float fac; } Range; typedef struct { const char* name; Range test[N_TESTS]; } Sample; -enum {SAMPLES = 2, N = 8000000, R = 4}; +enum {SAMPLES = 2, N = 2000000, R = 4}; uint64_t seed = 1, mask1 = 0xffffffff; static float secs(Range s) { return (float)(s.t2 - s.t1) / CLOCKS_PER_SEC; } @@ -92,7 +92,7 @@ Sample test_stc_unordered_map() { s.test[FIND].t1 = clock(); size_t sum = 0; const cmap_x_value* val; - c_forrange (N) + c_forrange (N) if ((val = cmap_x_get(&con, crand() & mask1))) sum += val->second; s.test[FIND].t2 = clock(); @@ -139,4 +139,4 @@ int main(int argc, char* argv[]) c_forrange (j, N_TESTS) printf("%s,%s n:%d,%s,%.3f,%.3f\n", comp, stc_s[0].name, N, operations[j], secs(stc_s[0].test[j]), secs(std_s[0].test[j]) ? secs(stc_s[0].test[j])/secs(std_s[0].test[j]) : 1.0f); printf("%s,%s n:%d,%s,%.3f,%.3f\n", comp, stc_s[0].name, N, "total", stc_sum, stc_sum/std_sum); -}
\ No newline at end of file +} |
