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

core/state: initialize maps with known size #27222

Merged
merged 2 commits into from
May 8, 2023
Merged

Conversation

ucwong
Copy link
Contributor

@ucwong ucwong commented May 5, 2023

No description provided.

for k, v := range s.snapAccounts {
state.snapAccounts[k] = v
}
state.snapStorage = make(map[common.Hash]map[common.Hash][]byte)
state.snapStorage = make(map[common.Hash]map[common.Hash][]byte, len(s.snapStorage))
for k, v := range s.snapStorage {
temp := make(map[common.Hash][]byte)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe here too?

Copy link
Contributor Author

@ucwong ucwong May 5, 2023

Choose a reason for hiding this comment

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

Maybe here too?

Oh yes, this also can be defined with fixed size

@fjl fjl changed the title core/state : fix map size avoid resizing core/state: initialize maps with known size May 7, 2023
@karalabe karalabe added this to the 1.11.7 milestone May 8, 2023
@karalabe karalabe merged commit cc8d40c into ethereum:master May 8, 2023
shekhirin pushed a commit to shekhirin/go-ethereum that referenced this pull request Jun 6, 2023
* core/state : fix map size avoid resizing

* core/state : fixed size
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
* core/state : fix map size avoid resizing

* core/state : fixed size
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
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