The GitHub Actions job "Tests" on airflow.git/backport-61483 has succeeded.
Run started by GitHub user pierrejeambrun (triggered by pierrejeambrun).

Head commit for run:
5b3307490e1dd6688681c516ea10e2d3f35bb45e / john-rodriguez-mgni 
<[email protected]>
perf(api): optimize /ui/dags endpoint serialization (#61483)

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.

Co-authored-by: Cursor <[email protected]>
(cherry picked from commit a915216434cf583b0b54eee129cc9a93b96492b2)

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

With regards,
GitHub Actions via GitBox


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

Reply via email to