From daea83d2cf60b83aa009a1f9b316d89156d59eb4 Mon Sep 17 00:00:00 2001 From: Rowan Trollope Date: Fri, 31 Jan 2025 17:21:39 -0600 Subject: [PATCH] Moved hardcoded default EF of 100 (during threaded search) to define. --- dump.rdb | Bin 0 -> 280 bytes vset.c | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 dump.rdb diff --git a/dump.rdb b/dump.rdb new file mode 100644 index 0000000000000000000000000000000000000000..7c378ad31a1d6b9c9d4dda468454060e9c19546d GIT binary patch literal 280 zcmWG?b@2=~FfcUy#aWb^l3A=7$I4t^U(dt=6a+~rFfjp1My5u4;j>mYy^r^@GAAdNurhnqa|6{d z!__bX)i>J5^tIb>^5|w|PRUPaW!9?K0;*wxs$m3M)M%gH-)(=zc`7ScZl!K&PHJvy r9?&@MdQ&DIpfw=NAXb8`7Xaf%`|LSW?Uy~VXZWui`cd5QVe3}_zKTl^ literal 0 HcmV?d00001 diff --git a/vset.c b/vset.c index c4b698df9..a8ca9f80a 100644 --- a/vset.c +++ b/vset.c @@ -23,8 +23,14 @@ static RedisModuleType *VectorSetType; static uint64_t VectorSetTypeNextId = 0; -#define VSET_DEFAULT_C_EF 200 // Default EF value if not specified. -#define VSET_DEFAULT_COUNT 10 // Default num elements returned by VSIM. +// Default EF value if not specified during creation. +#define VSET_DEFAULT_C_EF 200 + +// Default EF value if not specified during search. +#define VSET_DEFAULT_SEARCH_EF 100 + +// Default num elements returned by VSIM. +#define VSET_DEFAULT_COUNT 10 /* ========================== Internal data structure ====================== */ @@ -495,11 +501,10 @@ void *VSIM_thread(void *arg) { * way to provide enough recall. * * If the user didn't asked for a specific exploration, we use - * 50 as minimum, or we match count if count is greater than - * that. Otherwise the minumim will be the specified EF argument. */ - - if (ef == 0) ef = 100; // This is a decent default to go fast but avoid - // obvious local minima along the path. + * VSET_DEFAULT_SEARCH_EF as minimum, or we match count if count + * is greater than that. Otherwise the minumim will be the specified + * EF argument. */ + if (ef == 0) ef = VSET_DEFAULT_SEARCH_EF; if (count > ef) ef = count; /* Perform search */