Skip to content

Commit

Permalink
add benchmark for bitWriter WriteVlqInt()
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Fan committed Apr 12, 2024
1 parent 1859298 commit 68cdc29
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions go/parquet/internal/utils/bit_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ func TestBitWriter(t *testing.T) {
assert.Equal(t, byte(2), buf[4])
}

func BenchmarkBitWriter(b *testing.B) {
buf := make([]byte, b.N)
bw := utils.NewBitWriter(utils.NewWriterAtBuffer(buf))
for i := 0; i < b.N; i++ {
assert.True(b, bw.WriteVlqInt(uint64(1)))
}
}

func TestBitReader(t *testing.T) {
buf := []byte{0xAA, 0xCC} // 0b10101010 0b11001100

Expand Down

0 comments on commit 68cdc29

Please sign in to comment.