Original Post
Hello everyone.. I need to copy alot of memory fast.. Often, there'll be large segments that are equal on the dest and the source.. Say I have 1024 bytes in two buffers.. I need to copy from buffer1 to buffer2.. Sometimes there can be 128 bytes that are equal in the buffers.. So.. Should I 1. Just use memcpy() and copy everything all the time (how optimized is memcpy?) 2. Compare the buffers, say 64 bytes at a time, and if a change is detected, copy the remaining bytes of the chunk 3. Compare all the way and only write differences? We are talking several MBs at a time here, so it is important that it's done the fastest way possible.. On some systems, the readspeed is 3-5x faster than the write speed.. On my system, it's 3200mb vs 1300mb.. So, what do you suggest?