Re: [MERGE] branch prediction hints

From: Kinkie <gkinkie_at_gmail.com>
Date: Thu, 14 Oct 2010 10:06:15 +0200

2010/10/13 Henrik Nordström <henrik_at_henriknordstrom.net>:
> ons 2010-10-13 klockan 20:50 +0200 skrev Kinkie:
>> I agree. That's why I propose to only use it - if we do use it for
>> anything - for singletons, where it should be a no-brainer.
>
> Have you checked if it makes any difference in the proposed use you see
> today?

Yes it does.
The resulting code is more compact, and has a different jump
structure. Unfortunately I am not an assembler expert to judge whether
it is a good or a bad thing; if you wish I can attach the asm code of
the relevant function; in general I'd tend to trust the gcc authors,
and the fact that it's a technique widely used in a highly sensitive
project (the Linux kernel) [http://kerneltrap.org/node/4705].

IF we decide it's worth to use this, other obvious candeidates for
useage would be Must() and assert (the latter case may be already done
by the library for us). As I may have already stated, I would advise
against using this in "regular" code.

-- 
    /kinkie
Received on Thu Oct 14 2010 - 08:06:25 MDT

This archive was generated by hypermail 2.2.0 : Thu Oct 14 2010 - 12:00:04 MDT