(b *testing.B)
| 3801 | } |
| 3802 | |
| 3803 | func BenchmarkRepeatedSelfArrayUnion(b *testing.B) { |
| 3804 | bitmap := NewBitmap() |
| 3805 | for i := 0; i < 4096; i++ { |
| 3806 | bitmap.Add(uint32(2 * i)) |
| 3807 | } |
| 3808 | b.ReportAllocs() |
| 3809 | b.ResetTimer() |
| 3810 | for i := 0; i < b.N; i++ { |
| 3811 | receiver := NewBitmap() |
| 3812 | for j := 0; j < 1000; j++ { |
| 3813 | receiver.Or(bitmap) |
| 3814 | } |
| 3815 | } |
| 3816 | } |
| 3817 | |
| 3818 | // BenchmarkArrayIorMergeThreshold tests performance |
| 3819 | // when unioning two array containers when the cardinality sum is over 4096 |