Andrushika opened a new pull request, #72783:
URL: https://github.com/apache/airflow/pull/72783

   ### We can finally get rid of this!
   <img width="446" height="140" alt="image" 
src="https://github.com/user-attachments/assets/c1afdf88-e451-4d39-8354-2a599148b787";
 />
   
   ## Why
   
   `breeze start-airflow` hashes the UI directories before every start to 
decide if the assets need a rebuild. The hash in `compile_ui_assets.py` skips 
`node_modules` but not `.pnpm-store`, and it lists and resolves every path 
under both before filtering. With a 763 MB store this adds 16 to 30 seconds of 
"Still waiting" to every start, even with no changes. 
`compile_provider_assets.py` already skips `.pnpm-store`, this script missed it.
   
   ## What
   
   Walk the directory with `os.walk` and prune `node_modules` and `.pnpm-store` 
at the directory level, so the hash never lists, resolves, or reads anything 
under them.
   
   Measured on my main checkout, hash check only:
   
   | directory | before | after | files read |
   |---|---|---|---|
   | `airflow/ui` | 21.5s | **0.03s** | 102,129 → 1,592 |
   | `simple/ui` | 11.2s | **0.001s** | 55,274 → 66 |
   
   That is about **700x** optimization on the main UI. 
   In the old code, of the 21.5s, 12.2s was reading the 763 MB `.pnpm-store` 
into sha256 and 6.7s was `resolve()` on 173k paths that got filtered out right 
after. The full no-change run of the `compile-ui-assets` hook drops from 
**16.4s to 0.3s** on a worktree, and the 30 seconds of "Still waiting" on every 
`breeze start-airflow` are gone.
   
   The hash order changes, so the first start after this lands rebuilds once. 
Added a subprocess test in the same style as `test_compile_ui_assets_dev.py`, 
the `.pnpm-store` case fails without the fix.
   
   The same `rglob` pattern in `compile_provider_assets.py` costs about 2s per 
provider. I plan to send that as a follow-up PR.
   
   
   
   
   ---
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Fable 5.1)
   
   Generated-by: Claude Code (Fable 5.1) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to