Skip to content

Speed up breeze UI asset change detection by skipping pnpm store - #72783

Merged
potiuk merged 1 commit into
apache:mainfrom
Andrushika:speed-up-breeze-asset-compilation
Sep 9, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
Andrushika:speed-up-breeze-asset-compilation

Conversation

@Andrushika

Copy link
Copy Markdown
Contributor

We can finally get rid of this!

image

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?
  • Yes — Claude Code (Fable 5.1)

Generated-by: Claude Code (Fable 5.1) following the guidelines

breeze start-airflow hashes the UI directories before every start to
decide whether the assets need rebuilding. The hash excluded
node_modules but not .pnpm-store, and it listed and resolved every
path under both before filtering. With a 763 MB store this added
16 to 30 seconds of "Still waiting" to every start with no changes.
Pruning both directories during the walk brings the check down to
well under a second.

@ColtenOuO ColtenOuO left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, Strong improvement!

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

NICE!

@potiuk
potiuk merged commit a29cd6c into apache:main Sep 9, 2026
70 checks passed
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-3-test PR Link

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

#protm

It's a really nice improvement.

@Andrushika
Andrushika deleted the speed-up-breeze-asset-compilation branch September 9, 2026 11:35
potiuk pushed a commit that referenced this pull request Sep 9, 2026
…72801)

breeze start-airflow hashes the UI directories before every start to
decide whether the assets need rebuilding. The hash excluded
node_modules but not .pnpm-store, and it listed and resolved every
path under both before filtering. With a 763 MB store this added
16 to 30 seconds of "Still waiting" to every start with no changes.
Pruning both directories during the walk brings the check down to
well under a second.
(cherry picked from commit a29cd6c)

Co-authored-by: Andrew Chang <[email protected]>
@henry3260

Copy link
Copy Markdown
Member

#protm

It's a really nice improvement.

+1,thanks for driving this improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants