Skip to content

Add benchmark for expressions.#4366

Merged
gianm merged 2 commits intoapache:masterfrom
gianm:se-expr-benchmark
Jun 6, 2017
Merged

Add benchmark for expressions.#4366
gianm merged 2 commits intoapache:masterfrom
gianm:se-expr-benchmark

Conversation

@gianm
Copy link
Copy Markdown
Contributor

@gianm gianm commented Jun 6, 2017

The results in master, for the curious:

Benchmark                                 (rowsPerSegment)  Mode  Cnt    Score   Error  Units
ExpressionBenchmark.queryUsingExpression           1000000  avgt   30  118.803 ± 2.440  ms/op
ExpressionBenchmark.queryUsingJavaScript           1000000  avgt   30  106.804 ± 2.136  ms/op
ExpressionBenchmark.queryUsingNative               1000000  avgt   30   32.993 ± 0.603  ms/op

I hope we can use this in the future to guide optimization of the expression subsystem. It does a number of things sub-optimally right now.

@fjy
Copy link
Copy Markdown
Contributor

fjy commented Jun 6, 2017

👍

@gianm gianm modified the milestone: 0.10.2 Jun 6, 2017
Comment thread benchmarks/pom.xml Outdated
@@ -88,7 +93,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jmh.version>1.17.2</jmh.version>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also update JMH?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to 1.19.

private QueryableIndex index;
private JavaScriptAggregatorFactory javaScriptAggregatorFactory;
private DoubleSumAggregatorFactory expressionAggregatorFactory;
private ByteBuffer aggregationBuffer = ByteBuffer.allocate(Doubles.BYTES);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double.BYTES exists from Java 8

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched.

import java.util.function.Function;

@State(Scope.Benchmark)
@Fork(jvmArgsPrepend = "-server", value = 1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Java 8, -server is the default on 64-bit systems: http://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed from here and other similar benchmark files.

}

@Benchmark
@BenchmarkMode(Mode.AverageTime)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since all benchmarks in the class use the same mode and time unit, could be moved to the class header

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

@gianm
Copy link
Copy Markdown
Contributor Author

gianm commented Jun 6, 2017

@leventov Addressed your comments.

@gianm gianm merged commit fd55c89 into apache:master Jun 6, 2017
@gianm gianm added this to the 0.10.1 milestone Jun 6, 2017
@gianm gianm deleted the se-expr-benchmark branch June 6, 2017 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants