From 12431f229eaa55ee689be5078809e7ba9bfcad9b Mon Sep 17 00:00:00 2001 From: Richard Thier Date: Thu, 2 Oct 2025 04:51:33 +0200 Subject: [PATCH] rthier randomized only above threshold --- ypsu.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ypsu.cpp b/ypsu.cpp index 6428b48..7b1f8a0 100644 --- a/ypsu.cpp +++ b/ypsu.cpp @@ -231,8 +231,11 @@ static inline void do_thier3(uint32_t *a, int n) noexcept { /** rthier */ static inline void do_rthier(uint32_t *a, int n) noexcept { assert(n * uint32_t(sizeof(a[0])) <= INT_MAX); - uint32_t junk; - randominus(a, n, junk); + if(n > 140000000) { + /* Helps a bit against our worst cases in big numbers */ + uint32_t junk; + randominus(a, n, junk); + } std::vector tmp(n); thiersort3(a, &(tmp[0]), n); } @@ -945,6 +948,7 @@ int main(int argc, char **argv) { }); assert(w == expected); + /* w = v; measure(inputtype, "rmagyar", [&] { uint32_t junk; @@ -952,6 +956,7 @@ int main(int argc, char **argv) { MagyarSort::sort(&w[0], w.size()); }); assert(w == expected); + */ w = v; measure(inputtype, "gptbuck", [&] { gpt_bucket_sort(&w[0], w.size()); });