Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use linear search for small IndexMap #223

Open
stepancheg opened this issue Apr 15, 2022 · 2 comments
Open

Use linear search for small IndexMap #223

stepancheg opened this issue Apr 15, 2022 · 2 comments

Comments

@stepancheg
Copy link
Contributor

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

  • not allocate RawTable
  • linear search elements
@cuviper
Copy link
Member

cuviper commented Nov 16, 2022

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

@cuviper
Copy link
Member

cuviper commented Mar 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants