Skip to content

Commit

Permalink
added benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidu28 committed Feb 28, 2024
1 parent 39e0f61 commit 875db5e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions merkle_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1059,3 +1059,22 @@ func verifyBlockRootAgainstBeaconStateViaHistoricalSummaries(oracleBeaconStateRo
}
return epgcommon.ValidateProof(oracleBeaconStateRoot, proof, beaconBlockHeaderToVerifyRoot, historicalBlockHeaderIndex)
}

func BenchmarkComputeBeaconStateRoot(b *testing.B) {
for i := 0; i < b.N; i++ {
_, _ = epp.ComputeBeaconStateRoot(&oracleState)
}

}

func BenchmarkComputeBeaconStateTopLevelRoots(b *testing.B) {
for i := 0; i < b.N; i++ {
_, _ = epp.ComputeBeaconStateTopLevelRoots(&spec.VersionedBeaconState{Deneb: &oracleState})
}
}

func BenchmarkComputeValidatorTree(b *testing.B) {
for i := 0; i < b.N; i++ {
_, _ = epp.ComputeValidatorTree(oracleState.Slot, oracleState.Validators)
}
}

0 comments on commit 875db5e

Please sign in to comment.