Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
04a72260
Unverified
Commit
04a72260
authored
4 years ago
by
Melvin Junhee Woo
Committed by
GitHub
4 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snapshot: merge loops for better performance (#22160)
parent
59a79137
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
difflayer.go
core/state/snapshot/difflayer.go
+4
-8
No files found.
core/state/snapshot/difflayer.go
View file @
04a72260
...
...
@@ -191,19 +191,15 @@ func newDiffLayer(parent snapshot, root common.Hash, destructs map[common.Hash]s
if
blob
==
nil
{
panic
(
fmt
.
Sprintf
(
"account %#x nil"
,
accountHash
))
}
// Determine memory size and track the dirty writes
dl
.
memory
+=
uint64
(
common
.
HashLength
+
len
(
blob
))
snapshotDirtyAccountWriteMeter
.
Mark
(
int64
(
len
(
blob
)))
}
for
accountHash
,
slots
:=
range
storage
{
if
slots
==
nil
{
panic
(
fmt
.
Sprintf
(
"storage %#x nil"
,
accountHash
))
}
}
// Determine memory size and track the dirty writes
for
_
,
data
:=
range
accounts
{
dl
.
memory
+=
uint64
(
common
.
HashLength
+
len
(
data
))
snapshotDirtyAccountWriteMeter
.
Mark
(
int64
(
len
(
data
)))
}
// Determine memory size and track the dirty writes
for
_
,
slots
:=
range
storage
{
// Determine memory size and track the dirty writes
for
_
,
data
:=
range
slots
{
dl
.
memory
+=
uint64
(
common
.
HashLength
+
len
(
data
))
snapshotDirtyStorageWriteMeter
.
Mark
(
int64
(
len
(
data
)))
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment