Copilot commented on code in PR #701:
URL: https://github.com/apache/iceberg-cpp/pull/701#discussion_r3636266520


##########
src/iceberg/table_scan.cc:
##########
@@ -552,13 +572,22 @@ Result<std::vector<std::shared_ptr<FileScanTask>>> 
DataTableScan::PlanFiles() co
     return std::vector<std::shared_ptr<FileScanTask>>{};
   }
 
+  auto metrics_context = MetricsContext::Default();
+  std::shared_ptr<ScanMetrics> scan_metrics = 
ScanMetrics::Make(*metrics_context);
+  auto timed = scan_metrics->total_planning_duration->Start();

Review Comment:
   DataTableScan::PlanFiles() always allocates a 
DefaultMetricsContext/ScanMetrics (and all underlying counters/timers) even 
when no metrics reporter is configured, adding avoidable overhead to every scan 
plan. Consider using MetricsContext::Noop() when context_.metrics_reporter is 
null (or skipping metrics entirely in that case).



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to