github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/p2p/peers/benchmark_test.go (about)

     1  package peers
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/prysmaticlabs/go-bitfield"
     7  )
     8  
     9  func Benchmark_retrieveIndicesFromBitfield(b *testing.B) {
    10  	bv := bitfield.NewBitvector64()
    11  	for i := uint64(0); i < bv.Len(); i++ {
    12  		bv.SetBitAt(i, true)
    13  	}
    14  	b.ResetTimer()
    15  	for i := 0; i < b.N; i++ {
    16  		indicesFromBitfield(bv)
    17  	}
    18  }