Commit Graph

1 Commits

Author SHA1 Message Date
Michael Gottesman
00d4576977 [multimapcache] Add an efficient CRTP based write-once multimap cache that can be small.
The properties of this multimap cache are:

1. Values are stored (inline if Small) in a Vector and our map internally maps
   keys to (start, length) of slices of the Vector. This is done instead of
   storing arrays refs to ensure that if our array goes from small -> large, we
   do not have stale pointers.

2. Values are only allowed to be inserted all at once. This is ok, since this is
   a cache.

3. One is not storing individual small vectors in a map (or state storing
   SmallVectors). This can inadvertantly add up to using a lot of memory and is
   not needed for homogenous data.
2020-03-31 15:12:37 -07:00