Take the 2-minute tour ×  Under what circumstances should I
expect memcpys to outperform assignments on modern INTEL/AMD
hardware? I am using GCC 4.2.x on a 32 bit Intel platform (but
am interested in 64 bit as well).  share|improve this question
Interesting question! As you are obviously concerned on how to
improve the speed of memory operations: Recently I read about
the role of compression in memory transfer from someone
developing pyTables: pytables.org/docs/StarvingCPUs.pdf As
described there, the usual use of memcpy might be slow compared
to his improvements with very fast compressors (blosc). Please
regard this for high performance stuff only! –  math Mar 20 '12
at 19:48 add comment  1 Answer  up vote 26 down vote accepted
You should never expect them outperform assignments. The reason
is, the compiler will use memcpy anyway when it thinks it would
be faster (if you use optimize flags). If not and if the
structure is reasonable small that it fits into registers,
direct register manipulation could be u