The GitHub Actions job "Tests" on airflow.git/v3-1-test has failed.
Run started by GitHub user pierrejeambrun (triggered by pierrejeambrun).

Head commit for run:
11a1eaa9cb5d8c8833b7a1cc5b5491f2d44b2821 / Pierre Jeambrun 
<[email protected]>
perf(api): optimize /ui/dags endpoint serialization (#61483) (#63001)

This PR addresses a significant performance issue in the /ui/dags endpoint
where page load times scaled poorly with the number of DAGs (12-16 seconds
for just 25 DAGs in our testing).

Two optimizations are implemented:

1. Cache URLSafeSerializer for file_token generation
   - Previously, a new URLSafeSerializer was instantiated and
     conf.get_mandatory_value() was called for every DAG
   - Now uses @lru_cache to create the serializer once and reuse it

2. Eliminate redundant Pydantic validation in response construction
   - The original pattern used model_validate -> model_dump -> model_validate
     which caused triple serialization overhead per DAG
   - Now validates once with DAGResponse.model_validate(), then uses
     model_construct() to build DAGWithLatestDagRunsResponse

Together, these changes reduced page load time from 12-16 seconds to
~130ms in our dev environment.


(cherry picked from commit a915216434cf583b0b54eee129cc9a93b96492b2)

Co-authored-by: john-rodriguez-mgni 
<[email protected]>
Co-authored-by: Cursor <[email protected]>

Report URL: https://github.com/apache/airflow/actions/runs/22848019537

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to