use of jetbrains.exodus.core.dataStructures.hash.LongIterator in project xodus by JetBrains.
the class UpdatableEntityIdSortedSetCachedInstanceIterable method getOrCreateIdCollection.
@NotNull
private OrderedEntityIdCollection getOrCreateIdCollection() {
OrderedEntityIdCollection collection = this.idCollection;
if (collection == null) {
PersistentLongSet.ImmutableSet currentSet = localIds.beginRead();
final long[] result = new long[currentSet.size()];
final LongIterator it = currentSet.longIterator();
int i = 0;
while (it.hasNext()) {
result[i++] = it.next();
}
collection = EntityIdArrayCachedInstanceIterableFactory.makeIdCollection(entityTypeId, result);
this.idCollection = collection;
}
return collection;
}
use of jetbrains.exodus.core.dataStructures.hash.LongIterator in project xodus by JetBrains.
the class JMHPersistentLongSetIterationBenchmark method iterate23Tree.
@Benchmark
@Warmup(iterations = 6, time = 1)
@Measurement(iterations = 8, time = 1)
@Fork(5)
public long iterate23Tree() {
LongIterator iterator = treeSet.beginRead().longIterator();
long result = 0;
while (iterator.hasNext()) {
result += iterator.nextLong();
}
return result;
}
use of jetbrains.exodus.core.dataStructures.hash.LongIterator in project xodus by JetBrains.
the class JMHPersistentLongSetIterationBenchmark method iterateBitTree.
@Benchmark
@Warmup(iterations = 6, time = 1)
@Measurement(iterations = 8, time = 1)
@Fork(5)
public long iterateBitTree() {
LongIterator iterator = bitTreeSet.beginRead().longIterator();
long result = 0;
while (iterator.hasNext()) {
result += iterator.nextLong();
}
return result;
}
Aggregations