Test reference equality before structural equality#1644
Test reference equality before structural equality#1644
Conversation
There was a problem hiding this comment.
Pull request overview
Optimizes equality checks in CFAbstractStore by short-circuiting on reference equality before performing potentially more expensive structural equality checks, improving performance in a known hot path.
Changes:
- In
supersetOf, checksvalue == eValuebefore callingvalue.equals(eValue)across all internal maps. - In
equals, adds an earlythis == oreturn to avoid unnecessary work when comparing the same instance.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot Can you measure whether this has any performance benefit compared to CI running on master? |
Measured from CI data: for commit |
This was highlighted as a hot path and seems a simple optimization.