Skip to content

Commit

Permalink
Merge branch 'main' into rcs2-rebuild-connections
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Dec 20, 2023
2 parents a59fdb3 + 642ae13 commit 22fbbcb
Showing 1 changed file with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
import org.elasticsearch.common.util.LongArray;
import org.elasticsearch.compute.data.Block;
import org.elasticsearch.compute.data.BlockFactory;
import org.elasticsearch.compute.data.BooleanArrayBlock;
import org.elasticsearch.compute.data.BooleanArrayVector;
import org.elasticsearch.compute.data.BooleanBigArrayBlock;
import org.elasticsearch.compute.data.BooleanBigArrayVector;
import org.elasticsearch.compute.data.BooleanBlock;
import org.elasticsearch.compute.data.BooleanVector;
import org.elasticsearch.compute.data.BytesRefArrayBlock;
import org.elasticsearch.compute.data.BytesRefArrayVector;
import org.elasticsearch.compute.data.BytesRefBlock;
import org.elasticsearch.compute.data.BytesRefVector;
Expand All @@ -32,19 +30,16 @@
import org.elasticsearch.compute.data.ConstantDoubleVector;
import org.elasticsearch.compute.data.ConstantIntVector;
import org.elasticsearch.compute.data.ConstantLongVector;
import org.elasticsearch.compute.data.DoubleArrayBlock;
import org.elasticsearch.compute.data.DoubleArrayVector;
import org.elasticsearch.compute.data.DoubleBigArrayBlock;
import org.elasticsearch.compute.data.DoubleBigArrayVector;
import org.elasticsearch.compute.data.DoubleBlock;
import org.elasticsearch.compute.data.DoubleVector;
import org.elasticsearch.compute.data.IntArrayBlock;
import org.elasticsearch.compute.data.IntArrayVector;
import org.elasticsearch.compute.data.IntBigArrayBlock;
import org.elasticsearch.compute.data.IntBigArrayVector;
import org.elasticsearch.compute.data.IntBlock;
import org.elasticsearch.compute.data.IntVector;
import org.elasticsearch.compute.data.LongArrayBlock;
import org.elasticsearch.compute.data.LongArrayVector;
import org.elasticsearch.compute.data.LongBigArrayBlock;
import org.elasticsearch.compute.data.LongBigArrayVector;
Expand Down Expand Up @@ -146,6 +141,7 @@ public class BlockBenchmark {
private record BenchmarkBlocks(Block[] blocks, long[] checkSums) {};

private static BenchmarkBlocks buildBlocks(String dataType, String blockKind, int totalPositions) {
BlockFactory blockFactory = BlockFactory.getNonBreakingInstance();
Block[] blocks = new Block[NUM_BLOCKS_PER_ITERATION];
long[] checkSums = new long[NUM_BLOCKS_PER_ITERATION];

Expand All @@ -165,7 +161,7 @@ private static BenchmarkBlocks buildBlocks(String dataType, String blockKind, in

switch (blockKind) {
case "array" -> {
blocks[blockIndex] = new BooleanArrayBlock(
blocks[blockIndex] = blockFactory.newBooleanArrayBlock(
values,
totalPositions,
null,
Expand All @@ -178,7 +174,7 @@ private static BenchmarkBlocks buildBlocks(String dataType, String blockKind, in
int positionCount = firstValueIndexes.length - 1;
BitSet nulls = randomNulls(positionCount);

blocks[blockIndex] = new BooleanArrayBlock(
blocks[blockIndex] = blockFactory.newBooleanArrayBlock(
values,
positionCount,
firstValueIndexes,
Expand Down Expand Up @@ -252,7 +248,7 @@ private static BenchmarkBlocks buildBlocks(String dataType, String blockKind, in

switch (blockKind) {
case "array" -> {
blocks[blockIndex] = new BytesRefArrayBlock(
blocks[blockIndex] = blockFactory.newBytesRefArrayBlock(
values,
totalPositions,
null,
Expand All @@ -265,7 +261,7 @@ private static BenchmarkBlocks buildBlocks(String dataType, String blockKind, in
int positionCount = firstValueIndexes.length - 1;
BitSet nulls = randomNulls(positionCount);

blocks[blockIndex] = new BytesRefArrayBlock(
blocks[blockIndex] = blockFactory.newBytesRefArrayBlock(
values,
positionCount,
firstValueIndexes,
Expand Down Expand Up @@ -303,7 +299,7 @@ private static BenchmarkBlocks buildBlocks(String dataType, String blockKind, in

switch (blockKind) {
case "array" -> {
blocks[blockIndex] = new DoubleArrayBlock(
blocks[blockIndex] = blockFactory.newDoubleArrayBlock(
values,
totalPositions,
null,
Expand All @@ -316,7 +312,7 @@ private static BenchmarkBlocks buildBlocks(String dataType, String blockKind, in
int positionCount = firstValueIndexes.length - 1;
BitSet nulls = randomNulls(positionCount);

blocks[blockIndex] = new DoubleArrayBlock(
blocks[blockIndex] = blockFactory.newDoubleArrayBlock(
values,
positionCount,
firstValueIndexes,
Expand Down Expand Up @@ -384,7 +380,7 @@ private static BenchmarkBlocks buildBlocks(String dataType, String blockKind, in

switch (blockKind) {
case "array" -> {
blocks[blockIndex] = new IntArrayBlock(
blocks[blockIndex] = blockFactory.newIntArrayBlock(
values,
totalPositions,
null,
Expand All @@ -397,7 +393,7 @@ private static BenchmarkBlocks buildBlocks(String dataType, String blockKind, in
int positionCount = firstValueIndexes.length - 1;
BitSet nulls = randomNulls(positionCount);

blocks[blockIndex] = new IntArrayBlock(
blocks[blockIndex] = blockFactory.newIntArrayBlock(
values,
positionCount,
firstValueIndexes,
Expand Down Expand Up @@ -461,7 +457,7 @@ private static BenchmarkBlocks buildBlocks(String dataType, String blockKind, in

switch (blockKind) {
case "array" -> {
blocks[blockIndex] = new LongArrayBlock(
blocks[blockIndex] = blockFactory.newLongArrayBlock(
values,
totalPositions,
null,
Expand All @@ -474,7 +470,7 @@ private static BenchmarkBlocks buildBlocks(String dataType, String blockKind, in
int positionCount = firstValueIndexes.length - 1;
BitSet nulls = randomNulls(positionCount);

blocks[blockIndex] = new LongArrayBlock(
blocks[blockIndex] = blockFactory.newLongArrayBlock(
values,
positionCount,
firstValueIndexes,
Expand Down

0 comments on commit 22fbbcb

Please sign in to comment.