mbutrovich opened a new pull request, #3050: URL: https://github.com/apache/datafusion-comet/pull/3050
## Which issue does this PR close? N/A. ## Rationale for this change Profiling of Iceberg table scans revealed significant overhead from timer calls (`clock_gettime`) in the `IcebergFileStream` state machine. The baseline metrics were being recorded for every batch inside the state machine loop, resulting in O(`num_batches`) timer overhead instead of the expected O(`num_polls`). ## What changes are included in this PR? Move `baseline.record_poll()` from inside the state machine (where it wrapped every batch poll) to the top-level `poll_next()` method, matching the DataFusion `FileStream` pattern: - Remove nested `record_poll()` in the `Reading` state - Add `record_poll()` call at the top-level `poll_next()` This reduces timer syscalls from once-per-batch to once-per-poll while maintaining accurate baseline metrics. ## How are these changes tested? Existing tests. -- 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]
