Copying stuff in memory

memcpy is the fastest. It's supplied by the platform's libc and is usually very optimized. See also “How to memcpy bytes in stable rust”. clone_from_slice is replaced by memcpy by the optimizer if it's a &[u8] slice.