Search in sources :

Example 61 with RoaringBitmap

use of org.roaringbitmap.RoaringBitmap in project RoaringBitmap by RoaringBitmap.

the class RoaringBitmapBenchmark method inplace_andNot.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public RoaringBitmap inplace_andNot() {
    RoaringBitmap b1 = bitmap1.clone();
    b1.andNot(bitmap2);
    return b1;
}
Also used : RoaringBitmap(org.roaringbitmap.RoaringBitmap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 62 with RoaringBitmap

use of org.roaringbitmap.RoaringBitmap in project RoaringBitmap by RoaringBitmap.

the class RoaringBitmapBenchmark method inplace_andNot.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public RoaringBitmap inplace_andNot() {
    RoaringBitmap b1 = bitmap1.clone();
    b1.andNot(bitmap2);
    return b1;
}
Also used : RoaringBitmap(org.roaringbitmap.RoaringBitmap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 63 with RoaringBitmap

use of org.roaringbitmap.RoaringBitmap in project RoaringBitmap by RoaringBitmap.

the class RoaringBitmapBenchmark method setup.

@Setup
public void setup() {
    bitmap1 = new RoaringBitmap();
    bitmap2 = new RoaringBitmap();
    int k = 1 << 16;
    int i = 0;
    for (; i < 10000; ++i) {
        bitmap1.add(i * k);
    }
    for (; i < 10050; ++i) {
        bitmap2.add(i * k);
        bitmap1.add(i * k + 13);
    }
    for (; i < 20000; ++i) {
        bitmap2.add(i * k);
    }
    bitmap1.add(i * k);
}
Also used : RoaringBitmap(org.roaringbitmap.RoaringBitmap) Setup(org.openjdk.jmh.annotations.Setup)

Example 64 with RoaringBitmap

use of org.roaringbitmap.RoaringBitmap in project RoaringBitmap by RoaringBitmap.

the class RoaringBitmapBenchmark method inplace_and.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public RoaringBitmap inplace_and() {
    RoaringBitmap b1 = bitmap1.clone();
    b1.and(bitmap2);
    return b1;
}
Also used : RoaringBitmap(org.roaringbitmap.RoaringBitmap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 65 with RoaringBitmap

use of org.roaringbitmap.RoaringBitmap in project RoaringBitmap by RoaringBitmap.

the class ParallelAggregatorBenchmark method setup.

@Setup(Level.Trial)
public void setup() throws Exception {
    bitmaps = DATASET_CACHE.get(dataset, () -> {
        System.out.println("Loading" + dataset);
        ZipRealDataRetriever dataRetriever = new ZipRealDataRetriever(dataset);
        return StreamSupport.stream(dataRetriever.fetchBitPositions().spliterator(), false).map(RoaringBitmap::bitmapOf).toArray(RoaringBitmap[]::new);
    });
    immutableRoaringBitmaps = Arrays.stream(bitmaps).map(RoaringBitmap::toMutableRoaringBitmap).toArray(ImmutableRoaringBitmap[]::new);
}
Also used : ZipRealDataRetriever(org.roaringbitmap.ZipRealDataRetriever) ImmutableRoaringBitmap(org.roaringbitmap.buffer.ImmutableRoaringBitmap) RoaringBitmap(org.roaringbitmap.RoaringBitmap) ImmutableRoaringBitmap(org.roaringbitmap.buffer.ImmutableRoaringBitmap) MutableRoaringBitmap(org.roaringbitmap.buffer.MutableRoaringBitmap)

Aggregations

RoaringBitmap (org.roaringbitmap.RoaringBitmap)81 Benchmark (org.openjdk.jmh.annotations.Benchmark)14 Test (org.junit.jupiter.api.Test)10 Test (org.junit.Test)9 DataOutputStream (java.io.DataOutputStream)8 MutableRoaringBitmap (org.roaringbitmap.buffer.MutableRoaringBitmap)8 ByteArrayOutputStream (java.io.ByteArrayOutputStream)7 DataInputStream (java.io.DataInputStream)7 IOException (java.io.IOException)7 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)7 ByteArrayInputStream (java.io.ByteArrayInputStream)6 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)6 BitmapDataProvider (org.roaringbitmap.BitmapDataProvider)6 ByteString (com.google.protobuf.ByteString)5 ByteBuffer (java.nio.ByteBuffer)5 Setup (org.openjdk.jmh.annotations.Setup)5 SerialisationException (uk.gov.gchq.gaffer.exception.SerialisationException)5 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)4 FasterList (jcog.list.FasterList)4 Term (nars.term.Term)4