liran-funaro commented on a change in pull request #10593:
URL: https://github.com/apache/druid/pull/10593#discussion_r533120125
##########
File path:
benchmarks/src/test/java/org/apache/druid/benchmark/IncrementalIndexRowTypeBenchmark.java
##########
@@ -124,46 +131,51 @@ private MapBasedInputRow getStringRow(long timestamp, int
dimensionCount)
return new MapBasedInputRow(timestamp, dimensionList, builder.build());
}
- private IncrementalIndex makeIncIndex()
+ private IncrementalIndex<?> makeIncIndex()
{
- return new IncrementalIndex.Builder()
+ return appendableIndexSpec.builder()
.setSimpleTestingIndexSchema(aggs)
.setDeserializeComplexMetrics(false)
- .setMaxRowCount(MAX_ROWS)
- .buildOnheap();
+ .setMaxRowCount(rowsPerSegment)
+ .build();
}
@Setup
- public void setup()
+ public void setup() throws JsonProcessingException
{
- for (int i = 0; i < MAX_ROWS; i++) {
+ appendableIndexSpec = IncrementalIndexCreator.parseIndexType(indexType);
+
+ for (int i = 0; i < rowsPerSegment; i++) {
longRows.add(getLongRow(0, DIMENSION_COUNT));
}
- for (int i = 0; i < MAX_ROWS; i++) {
+ for (int i = 0; i < rowsPerSegment; i++) {
floatRows.add(getFloatRow(0, DIMENSION_COUNT));
}
- for (int i = 0; i < MAX_ROWS; i++) {
+ for (int i = 0; i < rowsPerSegment; i++) {
stringRows.add(getStringRow(0, DIMENSION_COUNT));
}
}
- @Setup(Level.Iteration)
+ @Setup(Level.Invocation)
public void setup2()
{
incIndex = makeIncIndex();
- incFloatIndex = makeIncIndex();
Review comment:
Notice that the setup level was changed to per invocation, so for each
benchmark, a new index is created.
There wasn't really a need for three different indices in the first place.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]