MCPcopy Create free account
hub / github.com/dgraph-io/dgraph-benchmarks / newList

Function newList

bitmap/main_test.go:320–339  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

318}
319
320func newList() []uint64 {
321 var l []uint64
322 max := int64(N) * 1000
323 for i := 0; i < N; i++ {
324 l = append(l, uint64(rand.Int63n(max)))
325 }
326 sort.Slice(l, func(i, j int) bool {
327 return l[i] < l[j]
328 })
329 out := l[:0]
330 var last uint64
331 for _, x := range l {
332 if x == last {
333 continue
334 }
335 last = x
336 out = append(out, x)
337 }
338 return out
339}
340
341// This is taking 16ms. Clone itself takes ~4ms. So, ~12ms for AND.
342func BenchmarkAnd(b *testing.B) {

Callers 1

BenchmarkContainsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected