Skip to content

Commit 8bd0989

Browse files
committed
WIP
1 parent edb6c03 commit 8bd0989

File tree

10 files changed

+156
-101
lines changed

10 files changed

+156
-101
lines changed

benchmarks/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,12 @@ exit
126126
Grab the async profiler from https://github.com/jvm-profiling-tools/async-profiler
127127
and run `prof async` like so:
128128
```
129-
gradlew -p benchmarks/ run --args 'LongKeyedBucketOrdsBenchmark.multiBucket -prof "async:libPath=/home/nik9000/Downloads/tmp/async-profiler-1.8.3-linux-x64/build/libasyncProfiler.so;dir=/tmp/prof;output=flamegraph"'
129+
gradlew -p benchmarks/ run --args 'LongKeyedBucketOrdsBenchmark.multiBucket -prof "async:libPath=/home/nik9000/Downloads/async-profiler-3.0-29ee888-linux-x64/lib/libasyncProfiler.so;dir=/tmp/prof;output=flamegraph"'
130130
```
131131

132+
Note: As of January 2025 the latest release of async profiler doesn't work
133+
with out JDK but the nightly is fine.
134+
132135
If you are on Mac, this'll warn you that you downloaded the shared library from
133136
the internet. You'll need to go to settings and allow it to run.
134137

benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/EvalBenchmark.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ public class EvalBenchmark {
9797
"add_double",
9898
"case_1_eager",
9999
"case_1_lazy",
100-
"coalesce_1_noop",
101-
"coalesce_1_eager",
102-
"coalesce_1_lazy",
100+
"coalesce_2_noop",
101+
"coalesce_2_eager",
102+
"coalesce_2_lazy",
103103
"date_trunc",
104104
"equal_to_const",
105105
"long_equal_to_long",
@@ -154,7 +154,7 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
154154
}
155155
yield evaluator;
156156
}
157-
case "coalesce_1_noop", "coalesce_1_eager", "coalesce_1_lazy" -> {
157+
case "coalesce_2_noop", "coalesce_2_eager", "coalesce_2_lazy" -> {
158158
FieldAttribute f1 = longField();
159159
FieldAttribute f2 = longField();
160160
Expression lhs = f1;
@@ -165,7 +165,7 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
165165
new Coalesce(Source.EMPTY, lhs, List.of(f2)),
166166
layout(f1, f2)
167167
).get(driverContext);
168-
String desc = operation.endsWith("lazy") ? "CoalesceEvaluator" : "CoalesceEvaluator"; // NOCOMMIT eager/lazy here
168+
String desc = operation.endsWith("lazy") ? "CoalesceLazyEvaluator" : "CoalesceEagerEvaluator";
169169
if (evaluator.toString().contains(desc) == false) {
170170
throw new IllegalArgumentException("Evaluator was [" + evaluator + "] but expected one containing [" + desc + "]");
171171
}
@@ -284,7 +284,7 @@ private static void checkExpected(String operation, Page actual) {
284284
}
285285
}
286286
}
287-
case "coalesce_1_noop" -> {
287+
case "coalesce_2_noop" -> {
288288
LongVector f1 = actual.<LongBlock>getBlock(0).asVector();
289289
LongVector result = actual.<LongBlock>getBlock(2).asVector();
290290
for (int i = 0; i < BLOCK_LENGTH; i++) {
@@ -294,7 +294,7 @@ private static void checkExpected(String operation, Page actual) {
294294
}
295295
}
296296
}
297-
case "coalesce_1_eager" -> {
297+
case "coalesce_2_eager" -> {
298298
LongBlock f1 = actual.<LongBlock>getBlock(0);
299299
LongVector f2 = actual.<LongBlock>getBlock(1).asVector();
300300
LongVector result = actual.<LongBlock>getBlock(2).asVector();
@@ -305,7 +305,7 @@ private static void checkExpected(String operation, Page actual) {
305305
}
306306
}
307307
}
308-
case "coalesce_1_lazy" -> {
308+
case "coalesce_2_lazy" -> {
309309
LongBlock f1 = actual.<LongBlock>getBlock(0);
310310
LongVector f2 = actual.<LongBlock>getBlock(1).asVector();
311311
LongVector result = actual.<LongBlock>getBlock(2).asVector();
@@ -380,7 +380,7 @@ private static Page page(String operation) {
380380
}
381381
yield new Page(builder.build());
382382
}
383-
case "case_1_eager", "case_1_lazy", "coalesce_1_noop" -> {
383+
case "case_1_eager", "case_1_lazy", "coalesce_2_noop" -> {
384384
var f1 = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
385385
var f2 = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
386386
for (int i = 0; i < BLOCK_LENGTH; i++) {
@@ -389,7 +389,7 @@ private static Page page(String operation) {
389389
}
390390
yield new Page(f1.build(), f2.build());
391391
}
392-
case "coalesce_1_eager", "coalesce_1_lazy" -> {
392+
case "coalesce_2_eager", "coalesce_2_lazy" -> {
393393
var f1 = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
394394
var f2 = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
395395
for (int i = 0; i < BLOCK_LENGTH; i++) {

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/BooleanBlockBuilder.java

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/BytesRefBlockBuilder.java

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/DoubleBlockBuilder.java

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/FloatBlockBuilder.java

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/IntBlockBuilder.java

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-BlockBuilder.java.st

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ $endif$
120120
return copyFrom(($Type$Block) block, beginInclusive, endExclusive);
121121
}
122122

123+
// NOCOMMIT it's slow to check if all values are null for single position copies.
124+
123125
/**
124126
* Copy the values in {@code block} from {@code beginInclusive} to
125127
* {@code endExclusive} into this builder.

0 commit comments

Comments
 (0)