Search in sources :

Example 1 with IndexedFloats

use of io.druid.segment.data.IndexedFloats in project druid by druid-io.

the class FloatCompressionBenchmark method readSkipping.

@Benchmark
public void readSkipping(Blackhole bh) throws IOException {
    IndexedFloats indexedFloats = supplier.get();
    int count = indexedFloats.size();
    float sum = 0;
    for (int i = 0; i < count; i += rand.nextInt(2000)) {
        sum += indexedFloats.get(i);
    }
    bh.consume(sum);
    indexedFloats.close();
}
Also used : IndexedFloats(io.druid.segment.data.IndexedFloats) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 2 with IndexedFloats

use of io.druid.segment.data.IndexedFloats in project druid by druid-io.

the class FloatCompressionBenchmark method readContinuous.

@Benchmark
public void readContinuous(Blackhole bh) throws IOException {
    IndexedFloats indexedFloats = supplier.get();
    int count = indexedFloats.size();
    float sum = 0;
    for (int i = 0; i < count; i++) {
        sum += indexedFloats.get(i);
    }
    bh.consume(sum);
    indexedFloats.close();
}
Also used : IndexedFloats(io.druid.segment.data.IndexedFloats) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

IndexedFloats (io.druid.segment.data.IndexedFloats)2 Benchmark (org.openjdk.jmh.annotations.Benchmark)2