File: lsh_benchmark_test.go

package info (click to toggle)
golang-github-ekzhu-minhash-lsh 1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 104 kB
  • sloc: makefile: 3
file content (19 lines) | stat: -rw-r--r-- 318 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package minhashlsh

import (
	"strconv"
	"testing"
)

func Benchmark_Insert10000(b *testing.B) {
	sigs := make([][]uint64, 10000)
	for i := range sigs {
		sigs[i] = randomSignature(64, int64(i))
	}
	b.ResetTimer()
	f := NewMinhashLSH16(64, 0.5)
	for i := range sigs {
		f.Add(strconv.Itoa(i), sigs[i])
	}
	f.Index()
}