Link to home
Start Free TrialLog in
Avatar of Ruttensoft
Ruttensoft

asked on

Fastes way to compare 2 big arrays

Hello

I have 2 bytearrays, they are very big (6MB). I want to compare them and save the differences into a new Bytearray. If nothing is changing, I put 0.

So I want to compare them, if there is a difference, I'll take the value of the bytearray 2, if not, I take value 0

I can loop through the Array but thats not really fast.

Heard something about bitshifting?

Thanks

James
ASKER CERTIFIED SOLUTION
Avatar of Mrunal
Mrunal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of magicdlf
magicdlf

Hello,

I think you have to traverse the lists to compare the data. Actually 6MB is not so big as you think, and you can break right away when you find difference between the array. I bet the full operation will be finished in 0.01 secs.  Hope this can help you. (The articles that mroonal provided also prove this).