> The only outstanding component that I need to redesign rely on the nextSetBit to search for a large number of random values from very large BitSet.Can you elaborate? Use code if needed.
--
You received this message because you are subscribed to the Google Groups "Roaring Bitmaps" group.
To unsubscribe from this group and stop receiving emails from it, send an email to roaring-bitmaps+unsubscribe@googlegroups.com.
To post to this group, send email to roaring-bitmaps@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/roaring-bitmaps/2aeda4e8-88be-422e-8bf4-46d980a6c60a%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Roaring Bitmaps" group.
To unsubscribe from this group and stop receiving emails from it, send an email to roaring-bitmaps+unsubscribe@googlegroups.com.
To post to this group, send email to roaring-bitmaps@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/roaring-bitmaps/55f2ba4d-4775-4ace-b6c1-25961fe93060%40googlegroups.com.
int[] array = {185, 56, 144,...};
RoaringBitmap b = ...
int[] partofintersection = RoaringBitmap.intersect(array,b);
To view this discussion on the web visit https://groups.google.com/d/msgid/roaring-bitmaps/4d6c9e48-2f15-435a-ac9b-d1a11a9e8d89%40googlegroups.com.
RoaringBitmap b = ...
b.contains(185); // returns a boolean
b.contains(56); // returns a boolean
b.contains(144); // returns a booleanTo view this discussion on the web visit https://groups.google.com/d/msgid/roaring-bitmaps/4c913946-4796-4245-aac0-96099fce0696%40googlegroups.com.
The problem is in case when bit is not set, and I need to return nextSetBit.
override def nextSetBit(fromIndex: Int): Int = {It should return bit I'm looking for, or it would search for next bit which is set. This doesn't have good performance.
var currentIndex = fromIndex
var setBit = -1
while (currentIndex < nBits && setBit == -1) {
if (underlying.contains(currentIndex)) {
setBit = currentIndex
} else {
currentIndex += 1
}
}
setBit
}
BitSet density: 10% TIME:74
BitSet density: 25% TIME:357
BitSet density: 50% TIME:84
BitSet density: 75% TIME:69
BitSet density: 100% TIME:88
BitSet density: 25% looking for 50% of bits TIME:73
BitSet density: 50% looking for 75% of bits TIME:390
[info] JavaBitSetImplementationsNextSetBitBenchmark:
BitSet density: 10% TIME:24
BitSet density: 25% TIME:81
BitSet density: 50% TIME:133
BitSet density: 75% TIME:273
BitSet density: 100% TIME:460
BitSet density: 25% looking for 50% of bits TIME:120
BitSet density: 50% looking for 75% of bits TIME:445
[info] RoaringBitSetImplementationsNextSetBitBenchmark:
To view this discussion on the web visit https://groups.google.com/d/msgid/roaring-bitmaps/2a0261d5-655a-4c51-ade7-1a931cf097f0%40googlegroups.com.
override def nextSetBit(fromIndex: Int): Int = {
var currentIndex = fromIndex
var setBit = -1
while (currentIndex < nBits && setBit == -1) {
if (underlying.contains(currentIndex)) {
setBit = currentIndex
} else {
currentIndex += 1
}
}
setBit
}
BitSet density: 10% TIME:48
BitSet density: 25% TIME:394
BitSet density: 50% TIME:149
BitSet density: 75% TIME:300
BitSet density: 100% TIME:264
BitSet density: 25% looking for 50% of bits TIME:70
BitSet density: 50% looking for 75% of bits TIME:64
[info] JavaBitSetImplementationsNextSetBitBenchmark:
BitSet density: 10% TIME:20
BitSet density: 25% TIME:44
BitSet density: 50% TIME:130
BitSet density: 75% TIME:271
BitSet density: 100% TIME:452
BitSet density: 25% looking for 50% of bits TIME:117
BitSet density: 50% looking for 75% of bits TIME:467
[info] RoaringBitSetImplementationsNextSetBitBenchmark:
To view this discussion on the web visit https://groups.google.com/d/msgid/roaring-bitmaps/2a0261d5-655a-4c51-ade7-1a931cf097f0%40googlegroups.com.
if(bitmap.contains(fromIndex)){Shouldn't nextValue check if value is there and skip further code execution?
fromIndex
} else {
TypeConverter.longToInt(bitmap.nextValue(fromIndex))
}
itSet density: 10% TIME:33
BitSet density: 25% TIME:113
BitSet density: 50% TIME:52
BitSet density: 75% TIME:37
BitSet density: 100% TIME:49
BitSet density: 25% looking for 50% of bits TIME:25
BitSet density: 50% looking for 75% of bits TIME:42
BitSet density: 75% looking for 100% of bits TIME:48
BitSet density: 25% looking for 75% of bits TIME:52
[info] RoaringBitSetImplementationsNextSetBitBenchmark:
BitSet density: 10% TIME:32
BitSet density: 25% TIME:23
BitSet density: 50% TIME:43
BitSet density: 75% TIME:60
BitSet density: 100% TIME:113
BitSet density: 25% looking for 50% of bits TIME:48
BitSet density: 50% looking for 75% of bits TIME:70
BitSet density: 75% looking for 100% of bits TIME:106
BitSet density: 25% looking for 75% of bits TIME:97
[info] InMemoryBitSetImplementationsNextSetBitBenchmark:
To view this discussion on the web visit https://groups.google.com/d/msgid/roaring-bitmaps/6c1e5a68-f7a0-4985-ab23-d1e1a049a88c%40googlegroups.com.