You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- The result of a lookup, keeping track of if a hash collision occured.
-- If a collision did not occur then it will have the Int value (-1).
dataLookupResa=Absent | Presenta!Int
I think we could slightly reduce the work that a subsequent insertKeyExists or deleteKeyExists has to perform by enhancing this location information with the sequence of array indices that lead to the relevant Leaf or Collision node:
type IndexPath = Word
data LookupRes a = Absent | Present a !IndexPath !Int
This IndexPath is basically a Hash with the difference that even for BitmapIndexed nodes, the array index can be computed with the simple index function instead of the more involved sparseIndex. We won't even need index and the Shift it requires, though, if we simply right-shift the IndexPath at each step.
I don't expect a large speedup from this, but maybe something like 2, 3%?!
alter
andalterF
rely onlookupRecordCollision
to gather information about the location of a key in the map. This info is stored in aLookupRes
:unordered-containers/Data/HashMap/Internal.hs
Lines 654 to 656 in 8bb958e
I think we could slightly reduce the work that a subsequent
insertKeyExists
ordeleteKeyExists
has to perform by enhancing this location information with the sequence of array indices that lead to the relevantLeaf
orCollision
node:This
IndexPath
is basically aHash
with the difference that even forBitmapIndexed
nodes, the array index can be computed with the simpleindex
function instead of the more involvedsparseIndex
. We won't even needindex
and theShift
it requires, though, if we simply right-shift theIndexPath
at each step.I don't expect a large speedup from this, but maybe something like 2, 3%?!
unordered-containers/Data/HashMap/Internal.hs
Lines 1385 to 1422 in 8bb958e
The text was updated successfully, but these errors were encountered: