Skip to content

reflect.DeepEqual, not even once #95

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

Merged
merged 1 commit into from
Aug 16, 2019

Conversation

lavalamp
Copy link
Contributor

This change is a huge improvement:

benchmark                                              old ns/op     new ns/op     delta
BenchmarkDeducedSimple-12                              343266        296104        -13.74%
BenchmarkDeducedNested-12                              900868        765058        -15.08%
BenchmarkDeducedNestedAcrossVersion-12                 1004928       799466        -20.45%
BenchmarkLeafConflictAcrossVersion-12                  349167        279827        -19.86%
BenchmarkMultipleApplierRecursiveRealConversion-12     2231486       2149787       -3.66%

benchmark                                              old allocs     new allocs     delta
BenchmarkDeducedSimple-12                              1264           1098           -13.13%
BenchmarkDeducedNested-12                              3341           2965           -11.25%
BenchmarkDeducedNestedAcrossVersion-12                 3602           3112           -13.60%
BenchmarkLeafConflictAcrossVersion-12                  1296           1078           -16.82%
BenchmarkMultipleApplierRecursiveRealConversion-12     6841           6476           -5.34%
benchmark                       old ns/op     new ns/op     delta
BenchmarkApplyNewObject-12      1605549       1355981       -15.54%
BenchmarkUpdateNewObject-12     1752232       1565341       -10.67%
BenchmarkRepeatedUpdate-12      521986        443528        -15.03%
BenchmarkSetToFields-12         5156          5154          -0.04%
BenchmarkFieldsToSet-12         9908          10050         +1.43%
BenchmarkYAMLToTyped-12         54713         56860         +3.92%

benchmark                       old allocs     new allocs     delta
BenchmarkApplyNewObject-12      5045           4264           -15.48%
BenchmarkUpdateNewObject-12     5839           4850           -16.94%
BenchmarkRepeatedUpdate-12      1592           1255           -21.17%
BenchmarkSetToFields-12         14             14             +0.00%
BenchmarkFieldsToSet-12         82             82             +0.00%
BenchmarkYAMLToTyped-12         90             90             +0.00%

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 16, 2019
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 16, 2019
@@ -78,7 +78,7 @@ func TestResolve(t *testing.T) {
t.Errorf("expected Atom %v, got %v", tt.expectAtom, atom)
}
if exist != tt.expectExist {
t.Errorf("expeted exist %t, got %t", tt.expectExist, exist)
t.Errorf("expected exist %t, got %t", tt.expectExist, exist)
Copy link
Contributor

Choose a reason for hiding this comment

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

:-)

Copy link
Contributor

@apelisse apelisse left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

return false
}
for i := range a.Types {
if !a.Types[i].Equals(b.Types[i]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are they guaranteed to be sorted in the same order?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but reflect.DeepEqual behaved like this too...

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed!

},
}
for i, f := range funcs {
if err := quick.Check(f, nil); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 16, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: apelisse, 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 merged commit 53f1aee into kubernetes-sigs:master Aug 16, 2019
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants