mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
Add deserialization time in pcli benchmark (#12620)
This commit is contained in:
parent
1894a124ea
commit
cd8847c53b
@ -273,16 +273,18 @@ func benchmarkHash(sszPath string, sszType string) {
|
||||
if err := dataFetcher(sszPath, data); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
startDeserialize := time.Now()
|
||||
st, err := state_native.InitializeFromProtoCapella(data)
|
||||
if err != nil {
|
||||
log.Fatal("not a state")
|
||||
}
|
||||
deserializeDuration := time.Since(startDeserialize)
|
||||
start := time.Now()
|
||||
root, err := st.HashTreeRoot(context.Background())
|
||||
if err != nil {
|
||||
log.Fatal("couldn't hash")
|
||||
}
|
||||
fmt.Printf("Duration: %v HTR: %#x\n", time.Since(start), root)
|
||||
fmt.Printf("Deserialize Duration: %v, Hashing Duration: %v HTR: %#x\n", deserializeDuration, time.Since(start), root)
|
||||
return
|
||||
default:
|
||||
log.Fatal("Invalid type")
|
||||
|
Loading…
Reference in New Issue
Block a user