Bas Harenslak created AIRFLOW-4377:
--------------------------------------
Summary: 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
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)