summaryrefslogtreecommitdiffhomepage
path: root/misc/benchmarks/shootout_hashmaps.cpp
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-03-07 22:26:36 +0100
committerTyge Løvset <[email protected]>2023-03-07 22:26:36 +0100
commitecc0b2108cffeb725e3b8e2574b6fb7927dfd96e (patch)
tree221a40b1e41f64353e2b3143277a250ef2ae2ce5 /misc/benchmarks/shootout_hashmaps.cpp
parenta203314647b5c37c7e40230551457f006ff36cd5 (diff)
downloadSTC-modified-ecc0b2108cffeb725e3b8e2574b6fb7927dfd96e.tar.gz
STC-modified-ecc0b2108cffeb725e3b8e2574b6fb7927dfd96e.zip
Improved/simplified c_forfilter (): last optional parameter gone. Now c_flt_take() and c_flt_takewhile() breaks the loop always.
c11/fmt.h : renamed fmt_freebuffer(buf) => fmt_destroy(buf).
Diffstat (limited to 'misc/benchmarks/shootout_hashmaps.cpp')
-rw-r--r--misc/benchmarks/shootout_hashmaps.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/misc/benchmarks/shootout_hashmaps.cpp b/misc/benchmarks/shootout_hashmaps.cpp
index da523d71..39ad1786 100644
--- a/misc/benchmarks/shootout_hashmaps.cpp
+++ b/misc/benchmarks/shootout_hashmaps.cpp
@@ -2,7 +2,7 @@
#include <time.h>
#include <stc/crandom.h>
-#define MAX_LOAD_FACTOR 77
+#define MAX_LOAD_FACTOR 85
#ifdef __cplusplus
#include <limits>
@@ -314,7 +314,7 @@ int main(int argc, char* argv[])
unsigned n = n_mill * 1000000;
unsigned N1 = n, N2 = n, N3 = n, N4 = n, N5 = n;
stc64_t rng;
- size_t seed = time(NULL);
+ size_t seed = 123456; // time(NULL);
printf("\nUnordered hash map shootout\n");
printf("KMAP = https://github.com/attractivechaos/klib\n"
@@ -334,14 +334,14 @@ int main(int argc, char* argv[])
printf("\nT1: Insert %g mill. random keys range [0, 2^%u): map[rnd] = i;\n", N1/1000000.0, keybits);
RUN_TEST(1)
- printf("\nT2: Insert %g mill. SEQUENTIAL keys, erase them in same order:\n", N2/1000000.0);
- RUN_TEST(2)
+ //printf("\nT2: Insert %g mill. SEQUENTIAL keys, erase them in same order:\n", N2/1000000.0);
+ //RUN_TEST(2)
printf("\nT3: Erase all elements by lookup (%u mill. random inserts), key range [0, 2^%u)\n", n_mill*2, keybits);
RUN_TEST(3)
- printf("\nT4: Iterate map with Min(%u mill, 2^%u) inserts repeated times:\n", n_mill, keybits+1);
- RUN_TEST(4)
+ //printf("\nT4: Iterate map with Min(%u mill, 2^%u) inserts repeated times:\n", n_mill, keybits+1);
+ //RUN_TEST(4)
printf("\nT5: Lookup mix of random/existing keys in range [0, 2^%u). Num lookups depends on size.\n", keybits);
RUN_TEST(5)