Repository: incubator-airflow Updated Branches: refs/heads/master 4cd72b91b -> 68535d188
[AIRFLOW-2776] Compress tree view JSON The tree view generates JSON that can be massive for bigger DAGs, up to 10s of MBs. The JSON is currently prettified, which both takes up more CPU time during serialization, and slows down everything else that uses it. Considering the JSON is only meant to be used programmatically, this is an easy win Closes #3620 from abdul-stripe/smaller-tree-view- json Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/68535d18 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/68535d18 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/68535d18 Branch: refs/heads/master Commit: 68535d1886f22b0fa833727aac4d0ee3ce12edf1 Parents: 4cd72b9 Author: Abdul Nimeri <[email protected]> Authored: Thu Jul 26 20:53:57 2018 +0200 Committer: Bolke de Bruin <[email protected]> Committed: Thu Jul 26 20:53:57 2018 +0200 ---------------------------------------------------------------------- airflow/www/views.py | 3 ++- airflow/www_rbac/views.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/68535d18/airflow/www/views.py ---------------------------------------------------------------------- diff --git a/airflow/www/views.py b/airflow/www/views.py index ddd2765..178a8e6 100644 --- a/airflow/www/views.py +++ b/airflow/www/views.py @@ -1477,7 +1477,8 @@ class Airflow(BaseView): for d in dates], } - data = json.dumps(data, indent=4, default=json_ser) + # minimize whitespace as this can be huge for bigger dags + data = json.dumps(data, default=json_ser, separators=(',', ':')) session.commit() form = DateTimeWithNumRunsForm(data={'base_date': max_date, http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/68535d18/airflow/www_rbac/views.py ---------------------------------------------------------------------- diff --git a/airflow/www_rbac/views.py b/airflow/www_rbac/views.py index 44efac9..4673def 100644 --- a/airflow/www_rbac/views.py +++ b/airflow/www_rbac/views.py @@ -1208,7 +1208,8 @@ class Airflow(AirflowBaseView): for d in dates], } - data = json.dumps(data, indent=4, default=json_ser) + # minimize whitespace as this can be huge for bigger dags + data = json.dumps(data, default=json_ser, separators=(',', ':')) session.commit() form = DateTimeWithNumRunsForm(data={'base_date': max_date,
