Skip to content

Conversation

@bbovenzi
Copy link
Contributor

@bbovenzi bbovenzi commented Jan 7, 2026

Virtualize the grid view to improve rendering performance on very large dags.

Before (10 dag runs with 1000 tasks):
Screenshot 2026-01-07 at 4 32 40 PM

After (10 dag runs with 1000 tasks):
Screenshot 2026-01-07 at 4 55 05 PM

Results go from unusable to slow. I'll look for other improvements in follow up PRs. Notably some of the API calls still take 1-3 seconds.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Jan 7, 2026
@bbovenzi bbovenzi added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Jan 7, 2026
@bbovenzi bbovenzi added this to the Airflow 3.1.6 milestone Jan 7, 2026
@dheerajturaga
Copy link
Member

@bbovenzi, Im seeing for large dags the grid view task alignment is broken in this PR

Grid View misaligned

here's my dag

"""
DAG for testing Grid View performance with 5000 tasks.

This DAG creates a complex structure with:
- 50 top-level task groups
- Each group contains 100 tasks organized in 10 sub-groups
- Mix of sequential and parallel dependencies
- Total: 5000 EmptyOperator tasks
"""
from airflow.sdk import DAG
from airflow.sdk.definitions.taskgroup import TaskGroup
from airflow.operators.empty import EmptyOperator
from datetime import datetime


with DAG(
    dag_id="grid_view_performance_test_5000_tasks",
    start_date=datetime(2025, 1, 1),
    schedule=None,
    catchup=False,
    tags=["performance", "test", "grid_view"],
    description="Complex DAG with 5000 tasks to test grid view performance",
) as dag:

    # Entry point task
    start = EmptyOperator(task_id="start")

    # Exit point task
    end = EmptyOperator(task_id="end")

    previous_group_final_tasks = [start]

    # Create 50 main task groups
    for main_group_idx in range(50):
        with TaskGroup(group_id=f"main_group_{main_group_idx}") as main_group:

            # Entry task for this main group
            group_start = EmptyOperator(task_id="group_start")

            # Exit task for this main group
            group_end = EmptyOperator(task_id="group_end")

            sub_group_final_tasks = []

            # Create 10 sub-groups within each main group
            for sub_group_idx in range(10):
                with TaskGroup(group_id=f"sub_group_{sub_group_idx}") as sub_group:

                    # Create 10 tasks per sub-group (10 sub-groups * 10 tasks = 100 tasks per main group)
                    sub_tasks = []
                    for task_idx in range(10):
                        task = EmptyOperator(task_id=f"task_{task_idx}")
                        sub_tasks.append(task)

                    # Create dependencies within sub-group
                    # First 5 tasks run in parallel, then next 5 tasks depend on them
                    for i in range(5, 10):
                        sub_tasks[i - 5] >> sub_tasks[i]

                    # Last task of sub-group
                    sub_group_final = sub_tasks[-1]

                # Connect group_start to each sub-group's first tasks
                group_start >> sub_tasks[0]
                group_start >> sub_tasks[1]

                # Collect final tasks from each sub-group
                sub_group_final_tasks.append(sub_group_final)

            # Connect all sub-group final tasks to group_end
            sub_group_final_tasks >> group_end

        # Connect previous groups to current group
        # Create some inter-group dependencies for complexity
        if main_group_idx % 5 == 0:
            # Every 5th group depends on all previous group tasks
            previous_group_final_tasks >> group_start
        else:
            # Other groups depend on the immediately previous group
            previous_group_final_tasks[-1] >> group_start

        # Track this group's final task
        previous_group_final_tasks.append(group_end)

    # Connect all final group tasks to the end task
    previous_group_final_tasks >> end

@bbovenzi
Copy link
Contributor Author

bbovenzi commented Jan 8, 2026

@bbovenzi, Im seeing for large dags the grid view task alignment is broken in this PR

Thanks. What OS+browser are you on?

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool! Tested locally and working as expected for me.

….tsx

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
@bbovenzi bbovenzi requested a review from choo121600 as a code owner January 8, 2026 15:54
@dheerajturaga
Copy link
Member

@bbovenzi, Im seeing for large dags the grid view task alignment is broken in this PR

Thanks. What OS+browser are you on?

chrome with airflow running on ubuntu (wsl) via breeze

@bbovenzi
Copy link
Contributor Author

bbovenzi commented Jan 8, 2026

@dheerajturaga Fixed

Screenshot 2026-01-08 at 1 14 38 PM

@bbovenzi bbovenzi mentioned this pull request Jan 8, 2026
@dheerajturaga
Copy link
Member

Thanks @bbovenzi , for implementing this! Very Cool! this is definitely a very big improvement (I'm seeing 4x improvement 8s -> 2s)

Old:
Bad performance times - 1

new:
good performance times - 1

@bbovenzi bbovenzi merged commit 7a64304 into apache:main Jan 8, 2026
128 checks passed
@bbovenzi bbovenzi deleted the virtualize-grid branch January 8, 2026 19:59
github-actions bot pushed a commit that referenced this pull request Jan 8, 2026
* Add virtualization to grid view

* Remove all jsx inline function declarations

* Remove awkward Bar code reuse, add nav mode const

* Remove extraneous code

* Update airflow-core/src/airflow/ui/src/layouts/Details/Grid/TaskNames.tsx

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>

* Fix scrollbars and horizontal scrolling

---------
(cherry picked from commit 7a64304)

Co-authored-by: Brent Bovenzi <brent@astronomer.io>
Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Backport successfully created: v3-1-test

Status Branch Result
v3-1-test PR Link

@kaxil
Copy link
Member

kaxil commented Jan 8, 2026

#protm

bbovenzi added a commit that referenced this pull request Jan 8, 2026
* Add virtualization to grid view

* Remove all jsx inline function declarations

* Remove awkward Bar code reuse, add nav mode const

* Remove extraneous code

* Update airflow-core/src/airflow/ui/src/layouts/Details/Grid/TaskNames.tsx



* Fix scrollbars and horizontal scrolling

---------
(cherry picked from commit 7a64304)

Co-authored-by: Brent Bovenzi <brent@astronomer.io>
Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow. Impressive!

@choo121600
Copy link
Member

Wow Coool!😲

stegololz pushed a commit to stegololz/airflow that referenced this pull request Jan 9, 2026
* Add virtualization to grid view

* Remove all jsx inline function declarations

* Remove awkward Bar code reuse, add nav mode const

* Remove extraneous code

* Update airflow-core/src/airflow/ui/src/layouts/Details/Grid/TaskNames.tsx

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>

* Fix scrollbars and horizontal scrolling

---------

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
ephraimbuddy pushed a commit that referenced this pull request Jan 13, 2026
* Add virtualization to grid view

* Remove all jsx inline function declarations

* Remove awkward Bar code reuse, add nav mode const

* Remove extraneous code

* Update airflow-core/src/airflow/ui/src/layouts/Details/Grid/TaskNames.tsx



* Fix scrollbars and horizontal scrolling

---------
(cherry picked from commit 7a64304)

Co-authored-by: Brent Bovenzi <brent@astronomer.io>
Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
ephraimbuddy pushed a commit that referenced this pull request Jan 14, 2026
* Add virtualization to grid view

* Remove all jsx inline function declarations

* Remove awkward Bar code reuse, add nav mode const

* Remove extraneous code

* Update airflow-core/src/airflow/ui/src/layouts/Details/Grid/TaskNames.tsx



* Fix scrollbars and horizontal scrolling

---------
(cherry picked from commit 7a64304)

Co-authored-by: Brent Bovenzi <brent@astronomer.io>
Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
ephraimbuddy pushed a commit that referenced this pull request Jan 16, 2026
* Add virtualization to grid view

* Remove all jsx inline function declarations

* Remove awkward Bar code reuse, add nav mode const

* Remove extraneous code

* Update airflow-core/src/airflow/ui/src/layouts/Details/Grid/TaskNames.tsx



* Fix scrollbars and horizontal scrolling

---------
(cherry picked from commit 7a64304)

Co-authored-by: Brent Bovenzi <brent@astronomer.io>
Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants