3 ms·
> If we convert each DID into a uint64 (a process referred to as “interning”), we can significantly compress the size of our graph and make it faster since our
by cryptonector 3y ago
> If we convert each DID into a uint64 (a process referred to as “interning”), we can significantly compress the size of our graph and make it faster since our hashing functions will have fewer bytes they need to work with.
I've done something like this for a production authorization system where one of the key steps is to check if an intersection of two [ordered] sets of 64-bit integers is empty or not. This operation first looks at the sizes of the two sets, and if one is much larger than the other then it iterates over the smaller set doing a binary search on the other for each item in the smaller set. If neither set is much larger than the other then the implementation walks a cursor through each set looking for equal items (and if at some point the remainder of one set is much smaller than the remainder of the other then it switches to the other algorithm). In most cases this deals with pairs of sets where one has thousands of elements and the other has tens to hundreds of elements, and it's blazingly fast. I could switch to 32-bit integers to make this go faster.