Skip to content

Conversation

@a-hilaly
Copy link
Member

This update enhances the logic for comparing resources in code
generation, especially for collections (maps and arrays) and blob
types. The previous method used nil checks, but they weren't
helpful for these types.

The revised code introduces a new function, fastCompareTypes,
to generate Go code that quickly compares two objects of the same
type. For collections, it uses the built-in len function to
swiftly spot length differences before diving into detailed checks.
For blobs, the code now employs the bytes.Equal function for
straightforward byte array comparisons.

This enhancement aims to make the generated comparison logic more
direct, readable, and efficient, especially when dealing with
collections and blobs in AWS SDK shapes.

Signed-off-by: Amine Hilaly [email protected]

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 23, 2023
@ack-prow ack-prow bot requested review from RedbackThomson and jljaco November 23, 2023 06:57
@ack-prow ack-prow bot added the approved label Nov 23, 2023
@a-hilaly
Copy link
Member Author

/hold

@ack-prow ack-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 23, 2023
This update enhances the logic for comparing resources in code
generation, especially for collections (maps and arrays) and blob
types. The previous method used nil checks, but they weren't
helpful for these types.

The revised code introduces a new function, `fastCompareTypes`,
to generate Go code that quickly compares two objects of the same
type. For collections, it uses the built-in `len` function to
swiftly spot length differences before diving into detailed checks.
For blobs, the code now employs the `bytes.Equal` function for
straightforward byte array comparisons.

This enhancement aims to make the generated comparison logic more
direct, readable, and efficient, especially when dealing with
collections and blobs in AWS SDK shapes.

Signed-off-by: Amine Hilaly <[email protected]>
@a-hilaly a-hilaly changed the title WIP: Enhance resource comparison for collections and blobs Enhance resource comparison for collections and blobs Dec 13, 2023
@ack-prow ack-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 13, 2023
@a-hilaly
Copy link
Member Author

/retest

@ivelichkovich
Copy link

/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2023
@ack-prow
Copy link

ack-prow bot commented Dec 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, ivelichkovich

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [a-hilaly,ivelichkovich]

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

@a-hilaly
Copy link
Member Author

/unhold

@ack-prow ack-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 13, 2023
@ack-prow ack-prow bot merged commit 9314627 into aws-controllers-k8s:main Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants