Skip to content

llbsolver: Fix performance of recomputeDigests#3732

Merged
sipsma merged 1 commit into
moby:masterfrom
sipsma:fix-recompute-digests
Mar 22, 2023
Merged

llbsolver: Fix performance of recomputeDigests#3732
sipsma merged 1 commit into
moby:masterfrom
sipsma:fix-recompute-digests

Conversation

@sipsma
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

4 participants