You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Xiaodong DENG (JIRA)" <ji...@apache.org> on 2019/04/22 08:39:00 UTC

[jira] [Resolved] (AIRFLOW-4377) Optimise object conversion in DAG.owner

     [ https://issues.apache.org/jira/browse/AIRFLOW-4377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiaodong DENG resolved AIRFLOW-4377.
------------------------------------
       Resolution: Resolved
         Assignee: Bas Harenslak
    Fix Version/s: 1.10.4

> 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
>            Assignee: Bas Harenslak
>            Priority: Minor
>             Fix For: 1.10.4
>
>
> 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)