Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Branch Misses

Name: Anonymous 2011-09-26 17:26

How bad do branch misses hurt a programs performance? In C and Java?

for example how big of an impact would :


int shitinanus()
{
    int val = getanus();
    if(val != 0)
        return ANALTONIGHT;
    return ALONETONIGHT;
}


be knowing that val will most likely be 0 99% of the time compared to the below function


int shitinanus()
{
    int val = getanus();
    if(val == 0)
        return ALONETONIGHT;
    return ANALTONIGHT;
}

Name: Anonymous 2011-09-28 12:20

>>52
Yes, the guy's so inept he failed to see that there are about three or four different people arguing with him (or, more precisely, being heavily trolled by him). Yet he took all of them for a single one. I guess this is indeed a sign of autism.

>>56
Fuck off, misfit. You trolled us hard already.

>>64
>>65
There's a very important point on creating and conforming to standards. However, as far as compliance goes, there are very few important implementations that fully comply to a given document. This makes people inevitably depend on extensions (since they won't and shouldn't bother, for example, sprinkling #ifdefs to detect particular differences between C compilers), specially because most people don't even know about standards, or don't bother reading long, prolix documents that, in practice, only diminishes their productivity.

Also, as per definition a standard encompasses the minimum common set of features for a given set of architectures, they always tend to deny support for newer technology (and by newer I actually mean "concurrent execution" and "networking" in pure C, as incredible as it seems), sticking only with long-dated primitivisms.

All of this means that one can expect much less than he wished for when dealing with standards, since they fail grossly on solving the single problem they were supposed to solve: portability.

For example, there is a ridiculous number of compilers that -fully- comply to C99: GCC and MSVC ain't two of them. (C99 is a ten-year-old document already, and C1X is already being baked.) The situation is much worse for C++98.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List