mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-26 05:17:22 +00:00
3767574c77
* Reduce allocations by specifying slice capacity eager * gofmt
23 lines
466 B
Go
23 lines
466 B
Go
package stateutil_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/state/stateutil"
|
|
)
|
|
|
|
func BenchmarkUint64ListRootWithRegistryLimit(b *testing.B) {
|
|
balances := make([]uint64, 100000)
|
|
for i := 0; i < len(balances); i++ {
|
|
balances[i] = uint64(i)
|
|
}
|
|
b.Run("100k balances", func(b *testing.B) {
|
|
for i := 0; i < b.N; i++ {
|
|
_, err := stateutil.Uint64ListRootWithRegistryLimit(balances)
|
|
if err != nil {
|
|
b.Fatal(err)
|
|
}
|
|
}
|
|
})
|
|
}
|