Search in sources :

Example 31 with ImmutableBitmap

use of org.apache.druid.collections.bitmap.ImmutableBitmap in project druid by druid-io.

the class DimensionPredicateFilterBenchmark method matchIsEven.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void matchIsEven() {
    final ImmutableBitmap bitmapIndex = IS_EVEN.getBitmapIndex(selector);
    Preconditions.checkState(bitmapIndex.size() == cardinality / 2);
}
Also used : ImmutableBitmap(org.apache.druid.collections.bitmap.ImmutableBitmap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 32 with ImmutableBitmap

use of org.apache.druid.collections.bitmap.ImmutableBitmap in project druid by druid-io.

the class LikeFilterBenchmark method matchSelectorEquals.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void matchSelectorEquals(Blackhole blackhole) {
    final ImmutableBitmap bitmapIndex = SELECTOR_EQUALS.getBitmapIndex(selector);
    blackhole.consume(bitmapIndex);
}
Also used : ImmutableBitmap(org.apache.druid.collections.bitmap.ImmutableBitmap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 33 with ImmutableBitmap

use of org.apache.druid.collections.bitmap.ImmutableBitmap in project druid by druid-io.

the class LikeFilterBenchmark method matchRegexPrefix.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void matchRegexPrefix(Blackhole blackhole) {
    final ImmutableBitmap bitmapIndex = REGEX_PREFIX.getBitmapIndex(selector);
    blackhole.consume(bitmapIndex);
}
Also used : ImmutableBitmap(org.apache.druid.collections.bitmap.ImmutableBitmap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 34 with ImmutableBitmap

use of org.apache.druid.collections.bitmap.ImmutableBitmap in project druid by druid-io.

the class LikeFilterBenchmark method matchLikeEquals.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void matchLikeEquals(Blackhole blackhole) {
    final ImmutableBitmap bitmapIndex = LIKE_EQUALS.getBitmapIndex(selector);
    blackhole.consume(bitmapIndex);
}
Also used : ImmutableBitmap(org.apache.druid.collections.bitmap.ImmutableBitmap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 35 with ImmutableBitmap

use of org.apache.druid.collections.bitmap.ImmutableBitmap in project druid by druid-io.

the class LikeFilterBenchmark method matchLikePrefix.

@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void matchLikePrefix(Blackhole blackhole) {
    final ImmutableBitmap bitmapIndex = LIKE_PREFIX.getBitmapIndex(selector);
    blackhole.consume(bitmapIndex);
}
Also used : ImmutableBitmap(org.apache.druid.collections.bitmap.ImmutableBitmap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Aggregations

ImmutableBitmap (org.apache.druid.collections.bitmap.ImmutableBitmap)64 Test (org.junit.Test)37 BitmapFactory (org.apache.druid.collections.bitmap.BitmapFactory)24 RoaringBitmapFactory (org.apache.druid.collections.bitmap.RoaringBitmapFactory)22 ConciseBitmapFactory (org.apache.druid.collections.bitmap.ConciseBitmapFactory)19 LinearGutmanSplitStrategy (org.apache.druid.collections.spatial.split.LinearGutmanSplitStrategy)18 IntIterator (org.roaringbitmap.IntIterator)17 Benchmark (org.openjdk.jmh.annotations.Benchmark)14 RadiusBound (org.apache.druid.collections.spatial.search.RadiusBound)13 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)13 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)13 Random (java.util.Random)12 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)12 BitmapIndex (org.apache.druid.segment.column.BitmapIndex)9 ArrayList (java.util.ArrayList)6 WrappedImmutableRoaringBitmap (org.apache.druid.collections.bitmap.WrappedImmutableRoaringBitmap)6 Filter (org.apache.druid.query.filter.Filter)6 ColumnHolder (org.apache.druid.segment.column.ColumnHolder)6 MutableBitmap (org.apache.druid.collections.bitmap.MutableBitmap)5 MutableRoaringBitmap (org.roaringbitmap.buffer.MutableRoaringBitmap)5