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/statesync use treepath #7783

Merged
merged 3 commits into from
Nov 21, 2024
Merged

Perf/statesync use treepath #7783

merged 3 commits into from
Nov 21, 2024

Conversation

asdacap
Copy link
Contributor

@asdacap asdacap commented Nov 21, 2024

  • Minor micro op to not make later change confusing.
  • Use Hash256+TreePath in state sync code.

Types of changes

What types of changes does your code introduce?

  • Optimization
  • Refactoring

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

  • Testing...

Comment on lines +208 to +211
for (int i = 0; i < bytes.Length - 1; i++)
{
bytes[i + 1] = ToByte((byte)nibbles[2 * i + oddity], (byte)nibbles[2 * i + 1 + oddity]);
}
Copy link
Member

Choose a reason for hiding this comment

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

@benaadams this and other loops like this in this file seem SIMDable?

@@ -95,24 +95,24 @@ private GetTrieNodesRequest GetGroupedRequest(StateSyncBatch batch)
{
GetTrieNodesRequest request = new() { RootHash = batch.StateRoot };

Dictionary<byte[], List<(byte[] path, StateSyncItem syncItem)>> itemsGroupedByAccount = new(Bytes.EqualityComparer);
List<(byte[] path, StateSyncItem syncItem)> accountTreePaths = new();
Dictionary<Hash256?, List<(TreePath path, StateSyncItem syncItem)>> itemsGroupedByAccount = new();
Copy link
Member

Choose a reason for hiding this comment

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

Hash256AsKey?

Copy link
Member

Choose a reason for hiding this comment

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

Problem with nullable

@asdacap asdacap merged commit 4b81930 into master Nov 21, 2024
79 checks passed
@asdacap asdacap deleted the perf/statesync-use-treepath branch November 21, 2024 23:04
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.

3 participants