• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 169
  • Last Modified:

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
0
Ruttensoft
Asked:
Ruttensoft
1 Solution
 
magicdlfCommented:
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).
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now