Skip to content

Commit

Permalink
Add BenchmarkRankListRange
Browse files Browse the repository at this point in the history
  • Loading branch information
werbenhu committed Dec 31, 2024
1 parent 28b0bb4 commit bbc43d0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ranklist_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ func BenchmarkRankListRank(b *testing.B) {
}
}

func BenchmarkRankListRange(b *testing.B) {
sl := New[int, int]()
for i := 0; i < 1000000; i++ {
sl.Set(i, i)
}

b.ResetTimer()
for i := 0; i < b.N; i++ {
sl.Range(0, 10)
}
}

func BenchmarkFastSkipListSet(b *testing.B) {
fast := fastskiplist.New()
b.ResetTimer()
Expand Down

0 comments on commit bbc43d0

Please sign in to comment.