From 9a013b7c68f94e6be0fe8748c9012a441fe0273f Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 12 Jan 2026 18:09:43 +0100 Subject: Improve performance of H48 solver with prefetching With this commit we re-structure how the node expansion in the H48 solution search works to allow prefetching of pruning values, showing performance improvements in the range of 30-45% on x86, depending on table size and solution length. A small bug fix related to appending solutions is included in this commit. --- src/utils/prefetch.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/utils/prefetch.h (limited to 'src/utils/prefetch.h') diff --git a/src/utils/prefetch.h b/src/utils/prefetch.h new file mode 100644 index 0000000..89b14e8 --- /dev/null +++ b/src/utils/prefetch.h @@ -0,0 +1,15 @@ +#if defined(AVX2) + +#define prefetch(a, i) _mm_prefetch(a+i, _MM_HINT_T0) + +#else +#if defined(__GNUC__) || defined(__clang__) + +#define prefetch(a, i) __builtin_prefetch(a+i, 0, 0) + +#else + +#define prefetch(a, i) (void)i + +#endif +#endif -- cgit v1.3