[webkit-dev] Time to remove LIKELY and UNLIKELY macros?

Ryosuke Niwa rniwa at webkit.org
Mon Oct 1 23:11:59 PDT 2012


I don't think so. I wrote a code that can be 10% slower without UNLIKELY
several weeks ago:
http://trac.webkit.org/browser/trunk/Source/WebCore/html/HTMLCollection.cpp#L289

On Mon, Oct 1, 2012 at 10:55 PM, Adam Barth <abarth at webkit.org> wrote:

> According to <
> http://stackoverflow.com/questions/1851299/is-it-possible-to-tell-the-branch-predictor-how-likely-it-is-to-follow-the-branc
> >,
> __builtin_expect (what our LIKELY and UNLIKELY macros expand to [1])
> doesn't do anything on modern CPUs.  Apparently, these used to be
> important for PowerPC, but I don't think many folks use WebKit on
> PowerPC anymore.
>
> Should we remove these macros?  I wasted some time today experimenting
> with them without realizing that they compile to no-ops in clang.
>
> Adam
>
> [1] http://trac.webkit.org/browser/trunk/Source/WTF/wtf/Compiler.h#L188
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20121001/ccd7589a/attachment.html>


More information about the webkit-dev mailing list