It is true that the standard's definition of memcpy is in terms of copying a sequence of bytes. It is also true that memcpy is one of the most important and most heavily optimized library functions. These days any credible compiler has a means of determining that an invocation of a function named 'memcpy' is actually an invocation of the standard's memcpy. E.g. gcc's exposed memcpy is an inline whose body simply calls __builtin_memcpy. With such knowledge a compiler can bring to bear all kinds of optimizations. Dmitry's measurements seem to bear this out. /john On Tue, Sep 24, 2013 at 2:35 AM, Eli Zaretskii wrote: > Does this change really speed up the code? AFAIU, previously the > struct assignment could use word-size copies (because a struct is > always aligned), but now you cast the arguments to 'char *' and use > memcpy, which could fall back on copying single bytes or shorter > words. > > Did you measure the impact? Was it significant enough to justify this > change? > >