Just working on a solidity code last day, I figured out that apart of comparing bytes, strings etc...
Keccak256 will be the perfect solution for comparing large arrays or big structs. Because as the Hash functions properties say:
Given x and y with the assumption (x != y) => We can assume that H(x) != H(y)
So comparing it's hashes will make us spend a lot less Gas than iterating the array, and demonstrate us that they are or no equal (doesn't matter on which index).
So with an example:
Let's supose that we have 2 large arrays of the same type. Will it be possible to do something as:
That is what you do in order to compare strings for example. (That if I'm not wrong, are interpreted as arrays at the end).
In order to don't do something like:
Assert.equal(array1[i], array2[i]); //Implemented on a for loop from i=0 to i=minlength(arr1,arr2)
Obviously, other implementations as adding mappings or stuff like that can solve quite well the problem, but I'm interested on knowing if there's any trick that allows you to compare this types of stuctures with the