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

perf: Avoid rehashing in index_map #1698

Closed
wants to merge 1 commit into from

Conversation

johnchildren
Copy link
Contributor

Description

The IndexMap data structure is an unordered_map which means that if the hash table is too small it can result in having to rehash all members of the table as seen in #1696 .

This commit attempts to reserve an exact size of hash table up front such that rehashing is unlikely as an additional optimization for large circuits.

Related issues

#1696 <- original issue
#1697 <- reduces the number of calls to index_map

Checklist

  • I have performed a self-review of my code.
  • I have commented hard-to-understand parts of my code.
  • I have made corresponding changes to the public API documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have updated the changelog with any user-facing changes.

The IndexMap data structure is an unordered_map which means that if the
hash table is too small it can result in having to rehash all members of
the table as seen in #1696 .

This commit attempts to reserve an exact size of hash table up front
such that rehashing is unlikely as an additional optimization for large
circuits.
@johnchildren
Copy link
Contributor Author

Closing in favor of: #1699

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

Successfully merging this pull request may close these issues.

1 participant