indexmap icon indicating copy to clipboard operation
indexmap copied to clipboard

Use linear search for small IndexMap

Open stepancheg opened this issue 2 years ago • 2 comments

When IndexMap is small, e. g. 5 elements, it is faster to:

  • not allocate RawTable
  • linear search elements

stepancheg avatar Apr 15 '22 08:04 stepancheg

I'm open to folks experimenting with this, but I think it will be nontrivial to plumb that condition through everywhere.

cuviper avatar Nov 16 '22 17:11 cuviper

I found halfbrown does this as an enum wrapper over hashbrown::HashMap. Someone could do the same kind of thing with IndexMap.

cuviper avatar Mar 02 '24 01:03 cuviper