Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore(raft): Add debug logs to print all transactions #8890

Merged
merged 12 commits into from
Jul 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed diffs
  • Loading branch information
Harshil Goel committed Jun 28, 2023
commit 16371451987b5638804f72d730b155be7e3f1462
30 changes: 11 additions & 19 deletions algo/uidlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ func BenchmarkListIntersectRandom(b *testing.B) {

func BenchmarkListIntersectRatio(b *testing.B) {
randomTests := func(sz int, overlap float64) {
rs := []int{1, 10, 50, 100, 200, 400, 500, 1000, 10000}
rs := []int{1, 10, 50, 100, 500, 1000, 10000, 100000, 1000000}
for _, r := range rs {
sz1 := sz
sz2 := sz * r
Expand All @@ -396,24 +396,16 @@ func BenchmarkListIntersectRatio(b *testing.B) {

fmt.Printf("len: %d, compressed: %d, bytes/int: %f\n",
len(v1), compressedUids.Size(), float64(compressedUids.Size())/float64(len(v1)))
b.Run(fmt.Sprintf("compressed:IntersectWithLinJump:ratio=%d:size=%d:overlap=%.2f:", r, sz, overlap),
b.Run(fmt.Sprintf(":IntersectWith:ratio=%d:size=%d:overlap=%.2f:", r, sz, overlap),
func(b *testing.B) {
for k := 0; k < b.N; k++ {
dec := codec.Decoder{Pack: compressedUids}
dec.Seek(0, codec.SeekStart)
dst := v.Uids[:0]

IntersectCompressedWithLinJump(&dec, u.Uids, &dst)
IntersectWith(u, v, dst1)
}
})
b.Run(fmt.Sprintf("compressed:IntersectWithBin:ratio=%d:size=%d:overlap=%.2f:", r, sz, overlap),
b.Run(fmt.Sprintf("compressed:IntersectWith:ratio=%d:size=%d:overlap=%.2f:", r, sz, overlap),
func(b *testing.B) {
for k := 0; k < b.N; k++ {
dec := codec.Decoder{Pack: compressedUids}
dec.Seek(0, codec.SeekStart)
dst := v.Uids[:0]

IntersectCompressedWithBin(&dec, u.Uids, &dst)
IntersectCompressedWith(compressedUids, 0, u, dst2)
}
})
fmt.Println()
Expand All @@ -435,12 +427,12 @@ func BenchmarkListIntersectRatio(b *testing.B) {
}
}

randomTests(10, 0.1)
randomTests(100, 0.1)
randomTests(1000, 0.1)
randomTests(10000, 0.1)
randomTests(100000, 0.1)
randomTests(1000000, 0.1)
randomTests(10, 0.01)
randomTests(100, 0.01)
randomTests(1000, 0.01)
randomTests(10000, 0.01)
randomTests(100000, 0.01)
randomTests(1000000, 0.01)
}

func skipDuplicate(in []uint64, idx int) int {
Expand Down