Skip to content

Commit

Permalink
bench 6
Browse files Browse the repository at this point in the history
  • Loading branch information
aliszka committed Oct 23, 2024
1 parent 53448ac commit e9f120a
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions bitmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1158,20 +1158,32 @@ func init() {
}
}

delta := (len(control) + controlsCount - 1) / controlsCount
for i := 0; i < controlsCount-1; i++ {
controls[i] = control[i*delta : (i+1)*delta]
delta := len(control) / controlsCount
rem := len(control) - delta*controlsCount

from := 0
for i := 0; i < rem; i++ {
to := from + delta + 1
fmt.Printf("f[%d]t[%d] ", from, to)
controls[i] = control[from:to]
from = to
}
for i := rem; i < controlsCount-1; i++ {
to := from + delta
fmt.Printf("f[%d]t[%d] ", from, to)
controls[i] = control[from:to]
from = to
}
controls[controlsCount-1] = control[(controlsCount-1)*delta:]
controls[controlsCount-1] = control[from:]

fmt.Printf(" ==> num keys [%d]\n", bm.keys.numKeys())
fmt.Printf(" ==> card [%d]\n", bm.GetCardinality())
fmt.Printf(" ==> control [%d]\n", len(control))
fmt.Printf(" ==> controlsCount [%d]:", controlsCount)
for i := range controls {
fmt.Printf(" %d", len(controls[i]))
}
fmt.Println()
// fmt.Printf(" ==> controlsCount [%d]:", controlsCount)
// for i := range controls {
// fmt.Printf(" %d", len(controls[i]))
// }
// fmt.Println()
fmt.Println()
}

Expand Down

0 comments on commit e9f120a

Please sign in to comment.