Skip to content

MerkleDB Adjust New View function(s) #1927

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

Merged
merged 18 commits into from
Aug 27, 2023

Conversation

dboehm-avalabs
Copy link
Contributor

Create a new map based NewView function which is easier to use for some callers. Add bool to both NewView functions to allow caller to specify if it is safe to not copy the []byte values. If it is safe to not copy, this unlocks a performance increase due to less allocations and copies.

@@ -38,7 +38,6 @@ const (
)

var (
_ TrieView = (*merkleDB)(nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer needed.

@StephenButtolph StephenButtolph changed the base branch from master to dev August 26, 2023 15:12
Comment on lines -683 to -685
if db.closed {
return nil, database.ErrClosed
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Kind of weird that this was removed - but because this is an internal function it makes sense that this should never really happen anyways

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we always check it before we call this function, so it couldn't really happen as you said.

@StephenButtolph StephenButtolph added this to the v1.10.10 milestone Aug 27, 2023
@StephenButtolph StephenButtolph merged commit b293d9e into dev Aug 27, 2023
@StephenButtolph StephenButtolph deleted the MerkleDBAlternativeConstructor branch August 27, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants