-
Notifications
You must be signed in to change notification settings - Fork 919
Open
Labels
consensusAn issue/PR that touches consensus code, such as state_processing or block verification.An issue/PR that touches consensus code, such as state_processing or block verification.dasData Availability SamplingData Availability Samplingmajor-taskA significant amount of work or conceptual task.A significant amount of work or conceptual task.optimizationSomething to make Lighthouse run more efficiently.Something to make Lighthouse run more efficiently.
Description
Gattaca have noted that our Blob
type is slower to SSZ decode than [u8; 128k]
:
The reason seems to be that our Blob
is heap-allocated:
lighthouse/consensus/types/src/lib.rs
Line 274 in cfb1f73
pub type Blob<E> = FixedVector<u8, <E as EthSpec>::BytesPerBlob>; |
The slowdown looks crazy on a % basis, but is very small in absolute terms. 5us vs 800us. It's less than a millisecond spent decoding objects that takes 10s-100s of milliseconds to verify.
I think we originally put blobs on the heap to avoid stack overflows caused by deeply nested futures? But my memory of this is a bit hazy. If it turns out that we don't need to do this, we could reconsider using stack-allocated blobs (or, realistically just Cell
s).
This could be related to:
I'll look at that next.
jimmygchen
Metadata
Metadata
Assignees
Labels
consensusAn issue/PR that touches consensus code, such as state_processing or block verification.An issue/PR that touches consensus code, such as state_processing or block verification.dasData Availability SamplingData Availability Samplingmajor-taskA significant amount of work or conceptual task.A significant amount of work or conceptual task.optimizationSomething to make Lighthouse run more efficiently.Something to make Lighthouse run more efficiently.