We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65d7bf6 commit 503c9e9Copy full SHA for 503c9e9
db/recsplit/eliasfano32/elias_fano_test.go
@@ -18,6 +18,7 @@ package eliasfano32
18
19
import (
20
"bytes"
21
+ "fmt"
22
"math"
23
"math/bits"
24
"testing"
@@ -590,6 +591,22 @@ func BenchmarkEF(b *testing.B) {
590
591
})
592
}
593
594
+func BenchmarkBuild(b *testing.B) {
595
+ for _, count := range []uint64{100, 1_000_000} {
596
+ b.Run(fmt.Sprintf("count=%d", count), func(b *testing.B) {
597
+ maxOffset := (count - 1) * 123
598
+ ef := NewEliasFano(count, maxOffset)
599
+ for i := uint64(0); i < count; i++ {
600
+ ef.AddOffset(i * 123)
601
+ }
602
+ b.ResetTimer()
603
+ for b.Loop() {
604
+ ef.Build()
605
606
+ })
607
608
+}
609
+
610
func naiveReverseIterator(ef *EliasFano) *stream.ArrStream[uint64] {
611
it := ef.Iterator()
612
var values []uint64
0 commit comments