How does Java: compare objects efficiently?

for example, there is a local class object
remotely calling an api to get the json string of another class object

now to judge whether the two objects are equal or not, we need a lot of comparisons.
is it more efficient to convert local objects to strings than remotely acquired json strings?
or convert the remotely acquired json string into an object
, and this class customizes an equals method for field comparison.
it is more efficient to use the equals method?

Jan.01,2022

convert json to object and then compare
not because of efficiency
but because two json with the same data may have different formats

< hr >

if you don't take these into account, you can only do the tests yourself, because different json libraries show different performance in the face of different objects / json

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3fe89-2c4b2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3fe89-2c4b2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?