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

mempool: Better index representation #1162

Merged
merged 1 commit into from
Aug 11, 2023
Merged

mempool: Better index representation #1162

merged 1 commit into from
Aug 11, 2023

Conversation

iljakuklic
Copy link
Contributor

Change Map<T, Set<TxId>> to Set<(T, TxId)>. This representation makes it easier to maintain certain invariants, eliminating some bookkeeping, and generally simplifies code.

It is also slightly more efficient, reducing mempool memory requirements by about 5-10%.

Change `Map<T, Set<TxId>>` to `Set<(T, TxId)>`. This representation
makes it easier to maintain certain invariants, eliminating some
bookkeeping, and generally simplifies code.

It is also slightly more efficient, reducing mempool memory requirements
by about 5-10%.
type TrackedTxIdMultiMap<K> = TrackedMap<K, TrackedSet<Id<Transaction>>>;
type TrackedTxIdMultiMap<K> = TrackedSet<(K, Id<Transaction>)>;
Copy link
Contributor Author

@iljakuklic iljakuklic Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the change. Everything else is to make the code work with this representation, usually simplifying the code in the process.

@iljakuklic iljakuklic merged commit 8f226c7 into master Aug 11, 2023
23 checks passed
@iljakuklic iljakuklic deleted the mempool-multimap branch August 11, 2023 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mempool Mempool-related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants