[
https://issues.apache.org/jira/browse/AIRFLOW-4377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16822950#comment-16822950
]
ASF GitHub Bot commented on AIRFLOW-4377:
-----------------------------------------
XD-DENG commented on pull request #5144: [AIRFLOW-4377] Remove needless type
conversion in DAG.owner()
URL: https://github.com/apache/airflow/pull/5144
----------------------------------------------------------------
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]
> Optimise object conversion in DAG.owner
> ---------------------------------------
>
> Key: AIRFLOW-4377
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4377
> Project: Apache Airflow
> Issue Type: Improvement
> Reporter: Bas Harenslak
> Priority: Minor
>
> Small optimisation possible in DAG.owner():
> Current implementation:
> {code}
> python -m timeit -n 1000000 '", ".join(list(set([i for i in ["test"]*100])))'
> 1000000 loops, best of 3: 4.47 usec per loop
> {code}
> The list & set conversion is not needed, so:
> {code}
> python -m timeit -n 1000000 '", ".join({i for i in ["test"]*100})'
> 1000000 loops, best of 3: 2.67 usec per loop
> {code}
> A +-40% speedup :)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)