-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
fix: state serialization time #7109
Conversation
@@ -15,19 +15,18 @@ export async function serializeState<T>( | |||
const size = state.type.tree_serializedSize(state.node); | |||
let stateBytes: Uint8Array | null = null; | |||
if (bufferPool) { | |||
const bufferWithKey = bufferPool.alloc(size, source); | |||
using bufferWithKey = bufferPool.alloc(size, source); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the main fix
Performance Report✔️ no performance regression detected Full benchmark results
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #7109 +/- ##
============================================
- Coverage 50.83% 50.82% -0.01%
============================================
Files 597 597
Lines 39789 39790 +1
Branches 2065 2057 -8
============================================
- Hits 20226 20224 -2
- Misses 19563 19566 +3 |
* fix: release memory to BufferPool * fix: correct the serializeState metric * fix: check types * chore: fix lint
🎉 This PR is included in v1.23.0 🎉 |
Motivation
There was a regression of v1.22 due to #7042 but it only affect n-historical-states configuration. This happens when we persist checkpoint state at every epoch
state serialization time was spiked because:
Description
"using"
key wordarchive_state
andpersistent_checkpoints_cache_state
flowwill follow up with Dashboard fix when this is merged
a prerequisite for #7104
Testing
It now takes less than 300ms to serialize a mainnet state