potiuk commented on code in PR #30361: URL: https://github.com/apache/airflow/pull/30361#discussion_r1157151324
########## airflow/executors/base_executor.py: ########## @@ -216,6 +215,8 @@ def heartbeat(self) -> None: self.log.debug("%s in queue", num_queued_tasks) self.log.debug("%s open slots", open_slots) + from airflow.stats import Stats Review Comment: I think those measurments for stats come from running it without "from airflow.configuration import conf". This is one of the most complex imports, and is about the only thing that seem to have measureable impect when importing stats module. If you look up the file it is already imported up there, conf is imported up there, so I think @uranusjr is right about this one, Same with the "Exceptions" Also why the measurement can be biased (for exceptions case) is that when we are importing any airflow package, we also import `airflow.__init__` and this one is also rather slow-ish with configuration and settings import. I tihnk this might have (If I am not mistaken) significant impct on the times measured for the imports done in isolation. My tests for one have shown that once `airflow.configuration.conf` is imported, stats and exceptions import instanteneously. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org