You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although PR #2792 reduces peak memory used by checkpointing by reusing ledger state, we can further reduce peak memory used by over 35GB during checkpoint serialization.
Replace largest data structure used for checkpoint serialization and process subtries instead of entire trie. Also use preallocations when feasible.
Optionally, allow a flag to specify the number of levels to use. Specifying 4 levels will use 16 subtries, which is a reasonable default for impactful memory savings and faster serialization.
Serializing data in parallel is made easier by this proposed change, but that is outside the scope of this issue.
Preliminary Results Using Levels=4 (16 Subtries)
Using August 12 mainnet checkpoint file with Go 1.18.5:
fxamacker
changed the title
[EN Performance] Further reduce peak memory used by checkpointing
[EN Performance] Reduce peak memory used by checkpointing by about 20-30GB
Aug 15, 2022
fxamacker
changed the title
[EN Performance] Reduce peak memory used by checkpointing by about 20-30GB
[EN Performance] Optimize checkpointing for -37GB operational RAM, -2.7 minutes duration, -19.6 million allocs (50% fewer allocs)
Aug 22, 2022
fxamacker
changed the title
[EN Performance] Optimize checkpointing for -37GB operational RAM, -2.7 minutes duration, -19.6 million allocs (50% fewer allocs)
[EN Performance] Optimize checkpoint serialization for -37GB operational RAM, -2.7 minutes duration, -19.6 million allocs (50% fewer allocs)
Aug 22, 2022
Problem
Although PR #2792 reduces peak memory used by checkpointing by reusing ledger state, we can further reduce peak memory used by over 35GB during checkpoint serialization.
Updates #1744
Proposed Solution
Replace largest data structure used for checkpoint serialization and process subtries instead of entire trie. Also use preallocations when feasible.
Optionally, allow a flag to specify the number of levels to use. Specifying 4 levels will use 16 subtries, which is a reasonable default for impactful memory savings and faster serialization.
Serializing data in parallel is made easier by this proposed change, but that is outside the scope of this issue.
Preliminary Results Using Levels=4 (16 Subtries)
Using August 12 mainnet checkpoint file with Go 1.18.5:
top
command), -23GB RAM (go bench B/op)No benchstat comparisons yet (n=5+) due to duration and memory (requires the big
benchnet-dev-004
server).EDIT: added more details after reading PR #3050 review comments.
The text was updated successfully, but these errors were encountered: