[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optimize glyph row clearing and copying routines

From: John Yates
Subject: Re: Optimize glyph row clearing and copying routines
Date: Tue, 24 Sep 2013 09:40:53 -0400

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.


On Tue, Sep 24, 2013 at 2:35 AM, Eli Zaretskii <address@hidden> 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

Did you measure the impact?  Was it significant enough to justify this

reply via email to

[Prev in Thread] Current Thread [Next in Thread]