Right now, the "fallback" duplicate check (when blst is disabled) is has a n^2 runtime. The blst version is using a red/black tree and has a log(n) runtime.
I'd consider:
At a minimum, making the fallback have a log(n) runtime (e.g., use BTreeSet).
Even better, use a HashSet for both. The rust HashSet is pretty damn fast and avoids hashing entirely for small sets, IIRC, so we shouldn't have any issues there.
Right now, the "fallback" duplicate check (when blst is disabled) is has a
n^2
runtime. Theblst
version is using a red/black tree and has alog(n)
runtime.I'd consider:
log(n)
runtime (e.g., useBTreeSet
).HashSet
for both. The rustHashSet
is pretty damn fast and avoids hashing entirely for small sets, IIRC, so we shouldn't have any issues there.