diff --git a/main.cpp b/main.cpp index 70188d8..b67d4f3 100644 --- a/main.cpp +++ b/main.cpp @@ -115,7 +115,7 @@ int main() { test_basics(mapmap, &mi); /* Performance tests */ - int i = 10000; + int i = 1000; keystore(i, true); datastore(i, true); diff --git a/makefile b/makefile index 89f37a1..7c6691d 100644 --- a/makefile +++ b/makefile @@ -2,8 +2,6 @@ debug: g++ main.cpp -g -Wall -o main release: g++ main.cpp -O2 -Wall -o main -release-native: - g++ main.cpp -fopt-info-vec-missed -march=native -O3 -Wall -o main release-avx2: g++ main.cpp -fopt-info-vec-missed -mavx2 -O3 -Wall -o main release-avx2-asm: diff --git a/simap.h b/simap.h index f2784c9..1f07449 100644 --- a/simap.h +++ b/simap.h @@ -95,6 +95,7 @@ typedef union simap_ptr64 simap_ptr64; // TODO: We can possibly hand-optimise this with intrinsics maybe - but I hope autovectorization (does not seem to happen???) static inline SM_ALWAYS_INLINE auint64 *make_tipp(auint64 *tip, auint64 prefix, auint64 *end) { + #pragma GCC unroll 4 while((tip < end) && (*tip != prefix)) ++tip; return tip; } @@ -111,8 +112,6 @@ static inline simap_ptr64 *simap_search_internal(simap_instance *map, const char /* Construct keyremains - might point to the \0 terminator only if smallkey or 8 bytes exactly */ const char *keyremains = key + prefixlen; - /* TODO: Maybe this is buggy when we access behind our own data? */ - /* TODO: Maybe I should create separate function for fast-lookup returning "next" pointer from a pointer to autovectorize? */ /* Lookup prefix (fast-key) - hopefully this gets vectorized (should be)!!! */ auint64 *base = map->base; auint64 *end = (auint64 *)((uint8_t *)base + (map->usage_end));