Skip to content

Conversation

alexzielenski
Copy link
Member

fixes an exponential recursion bug reproduced by the introduced benchmark

occurs when attempting to merge __untyped_deduced_ map with a nil value lhs and non-nil rhs. deduceAtom will just return the same input, so merge will create a new branch for recursion. Every nested level of fields ends up exponentially creating more merge branches. This PR adds logic so that the extra nil subtree is not traversed needlessly, and only the other operand's type is used for traversal.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 25, 2022
@alexzielenski
Copy link
Member Author

/cc @apelisse

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 25, 2022
@apelisse
Copy link
Contributor

Looks good to me, that's really awesome. We can't really show the performance improvement since the benchmark doesn't finish in the main branch.

@apelisse
Copy link
Contributor

Thanks,
/lgtm
@lavalamp, do you want to have a look? I'll approve if needed.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 26, 2022
@lavalamp
Copy link
Contributor

/lgtm
/approve

Thanks!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexzielenski, lavalamp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 26, 2022
@k8s-ci-robot k8s-ci-robot merged commit 5e8be97 into kubernetes-sigs:master Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants