From ee7a11a2796ccf63823a44da2bc2706d91b5a396 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 12 Nov 2023 14:35:25 -0500 Subject: [PATCH] Unify self-search hash thresholds across primitives; doesn't seem to hurt performance --- src/singeli/src/selfsearch.singeli | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/singeli/src/selfsearch.singeli b/src/singeli/src/selfsearch.singeli index 49dc9948..9aacc666 100644 --- a/src/singeli/src/selfsearch.singeli +++ b/src/singeli/src/selfsearch.singeli @@ -31,16 +31,13 @@ fn selfhashtab{T, name}(rp:*rty{name}, xp:*T, n:usz) = { # Resize or abort if more than 1/2^thresh collisions/element def {set_thresh, div_thresh} = { t:usz = 0 # Shift amount - def o = prim=='⊐' # Offset to allow effective t<0 - def div_thresh{i} = ((1<>t - def t0= has_radix*(prim=='∊') - def w = if (prim=='⊒') 1<<6 else wt<>t # Threshold setter, re-applied on resize def set_thresh{} = { - if (sz==msz) t = t0 - else if ((not has_radix) and sz>=(1<<24)/w) t = 0+o - else if ( sz>=(1<<20)/w) t = 3+o - else t = 5+o + if (sz==msz) t = 0 + else if ((not has_radix) and sz>=(1<<24)/wt) t = 0 + else if ( sz>=(1<<20)/wt) t = 3 + else t = 5 } tup{set_thresh, div_thresh} }