conjure-java icon indicating copy to clipboard operation
conjure-java copied to clipboard

Equals compares collections last

Open schlosna opened this issue 3 years ago • 2 comments

Before this PR

When evaluating equals(Object), collection types are compared before other relative cheaper fields.

After this PR

==COMMIT_MSG== Equals compares collections last ==COMMIT_MSG==

Possible downsides?

schlosna avatar Jul 20 '22 13:07 schlosna

Generate changelog in changelog/@unreleased

Type See change types. Select one:

  • [ ] Feature
  • [ ] Improvement
  • [ ] Fix
  • [ ] Break
  • [ ] Deprecation
  • [ ] Manual task
  • [ ] Migration

Description Equals compares collections last

Check the box to generate changelog(s)

  • [ ] Generate changelog entry

changelog-app[bot] avatar Jul 20 '22 13:07 changelog-app[bot]

Right now this is still just a raw WIP I wanted to brain dump as I was digging through a few JFR and saw some conjure types equals methods evaluating java.util.Collections$UnmodifiableSet.equals(Object).

There are some places where we might want to just manually reorder fields in yaml, but was thinking we could defer collection comparison to short-circuit in case of mismatches.

image

schlosna avatar Jul 20 '22 14:07 schlosna