Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llbsolver: Fix performance of recomputeDigests #3732

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

sipsma
Copy link
Collaborator

@sipsma sipsma commented Mar 22, 2023

Before this, in the case where nothing was mutated the visited memo would never be updated, thus causing exponential complexity.

Now the memo is updated even when nothing is mutated, just setting old and new to be the same digest.


This was causing real world performance regressions for dagger (due to the fact that dagger tries to by default propagate mount changes across every Exec, you can end up with fairly complicated LLB graphs pretty easily): dagger/dagger#4620

Before this, in the case where nothing was mutated the visited memo
would never be updated, thus causing exponential complexity.

Now the memo is updated even when nothing is mutated, just setting old
and new to be the same digest.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants