diff options
| author | tylov <[email protected]> | 2023-07-24 22:57:44 +0200 |
|---|---|---|
| committer | tylov <[email protected]> | 2023-07-24 22:57:44 +0200 |
| commit | 78ba677b59a8cecd69f733fca1a37ad01b38320f (patch) | |
| tree | 7a045c9c60ff74f6b04c10ce05921a3b3782c499 /misc/benchmarks/plotbench/csmap_benchmark.cpp | |
| parent | f1f0c01e798eb3217e62a43de660723173984547 (diff) | |
| download | STC-modified-78ba677b59a8cecd69f733fca1a37ad01b38320f.tar.gz STC-modified-78ba677b59a8cecd69f733fca1a37ad01b38320f.zip | |
Updated and fixed benchmarks and performance graphs.
Diffstat (limited to 'misc/benchmarks/plotbench/csmap_benchmark.cpp')
| -rw-r--r-- | misc/benchmarks/plotbench/csmap_benchmark.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/misc/benchmarks/plotbench/csmap_benchmark.cpp b/misc/benchmarks/plotbench/csmap_benchmark.cpp index 60f2db49..480163ed 100644 --- a/misc/benchmarks/plotbench/csmap_benchmark.cpp +++ b/misc/benchmarks/plotbench/csmap_benchmark.cpp @@ -8,7 +8,7 @@ #endif enum {INSERT, ERASE, FIND, ITER, DESTRUCT, N_TESTS}; -const char* operations[] = {"insert", "erase", "find", "iter", "destruct"}; +const char* operations[] = {"insert", "erase", "access", "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 = 1000000, R = 4}; @@ -47,12 +47,14 @@ Sample test_std_map() { s.test[FIND].t1 = clock(); size_t sum = 0; container::iterator it; - c_forrange (N) if ((it = con.find(crand() & mask1)) != con.end()) sum += it->second; + c_forrange (N) + if ((it = con.find(crand() & mask1)) != con.end()) + sum += it->second; s.test[FIND].t2 = clock(); s.test[FIND].sum = sum; s.test[ITER].t1 = clock(); sum = 0; - c_forrange (R) for (auto i: con) sum += i.second; + c_forrange (R) for (const auto& i: con) sum += i.second; s.test[ITER].t2 = clock(); s.test[ITER].sum = sum; s.test[DESTRUCT].t1 = clock(); |
