Ok, Im going to just disregard the suggestion to use Assembly...
I'll give you more insight in the situation, the arrays aren't sorted at all. They are filled using the GetDIBits, which get the bytes from a DeviceContext of 50x50 pixels. The result is that each array will size from somewhere around 2500 (8bit) to 7500 (24bit) elements. These need to be compared with a previously taken copy of that particular DC. If it is different, things are sent over winsock and the screen on the other side is updated accordingly.