the implementation it is already optimised. Under the hood object compression works more or less like this:
1. Check if object is the same (current vs object passed as argument)
2. Check hashCode (if equal go to step 3)
3. Check if values all hashCodes of properties declared in the primary constructor are equal