Skip to content

Commit

Permalink
add benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
minami14 committed Aug 14, 2019
1 parent 15981c0 commit 381d190
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bitarray_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,28 @@ func BenchmarkBitArray_Set(b *testing.B) {
}
}

func BenchmarkBoolSlice_Get(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()

boolSlice := make([]bool, b.N)

for i := 0; i < b.N; i++ {
_ = boolSlice[i]
}
}

func BenchmarkBoolSlice_Set(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()

boolSlice := make([]bool, b.N)

for i := 0; i < b.N; i++ {
boolSlice[i] = true
}
}

func BenchmarkBitArray8_Get(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
Expand Down

0 comments on commit 381d190

Please sign in to comment.