Skip to content

Commit

Permalink
GH-3002 start measuring performance before we initialise the iterator…
Browse files Browse the repository at this point in the history
… and add comment so we don't move it again by mistake

Signed-off-by: Håvard Ottestad <[email protected]>
  • Loading branch information
hmottestad committed Apr 17, 2021
1 parent 3395bbf commit 7ef1f62
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,17 +439,21 @@ private ValidationReport performValidation(List<Shape> shapes, boolean validateE
planNode.receiveLogger(validationExecutionLogger);
}

// Important to start measuring time before we call .iterator() since the initialisation of the
// iterator will already do a lot of work if there is for instance a Sort in the pipeline
// because Sort (among others) will consume its parent iterator and sort the results on
// initialization!
long before = 0;
if (sail.isPerformanceLogging()) {
before = System.currentTimeMillis();
}

try (CloseableIteration<? extends ValidationTuple, SailException> iterator = planNode
.iterator()) {
if (GlobalValidationExecutionLogging.loggingEnabled) {
logger.info("Start execution of plan:\n{}\n", shapePlanNodeTuple.getShape().toString());
}

long before = 0;
if (sail.isPerformanceLogging()) {
before = System.currentTimeMillis();
}

ValidationResultIterator validationResults;
try {
validationResults = new ValidationResultIterator(iterator,
Expand Down

0 comments on commit 7ef1f62

Please sign in to comment.